mirror of https://github.com/apache/activemq.git
recycle hash pages
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@631537 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5075fb9dea
commit
00893abe27
|
@ -23,6 +23,8 @@ import java.util.List;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import sun.security.action.GetBooleanAction;
|
||||
|
||||
/**
|
||||
* Bin in a HashIndex
|
||||
*
|
||||
|
@ -219,6 +221,11 @@ class HashBin {
|
|||
HashPageInfo page = getRetrievePage(index);
|
||||
int offset = getRetrieveOffset(index);
|
||||
HashEntry result = page.removeHashEntry(offset);
|
||||
|
||||
if (page.isEmpty()) {
|
||||
hashPages.remove(page);
|
||||
hashIndex.releasePage(page.getPage());
|
||||
}
|
||||
doUnderFlow(index);
|
||||
return result;
|
||||
}
|
||||
|
@ -295,9 +302,7 @@ class HashBin {
|
|||
}
|
||||
}
|
||||
|
||||
private void doUnderFlow(@SuppressWarnings("unused")
|
||||
int index) {
|
||||
// does little
|
||||
private void doUnderFlow(int index) {
|
||||
}
|
||||
|
||||
private void end() throws IOException {
|
||||
|
|
|
@ -462,8 +462,8 @@ public class HashIndex implements Index, HashIndexMBean {
|
|||
}
|
||||
|
||||
static {
|
||||
DEFAULT_PAGE_SIZE = Integer.parseInt(System.getProperty("defaultPageSize", "16384"));
|
||||
DEFAULT_KEY_SIZE = Integer.parseInt(System.getProperty("defaultKeySize", "96"));
|
||||
DEFAULT_BIN_SIZE= Integer.parseInt(System.getProperty("defaultBinSize", "1024"));
|
||||
DEFAULT_PAGE_SIZE = Integer.parseInt(System.getProperty("defaultPageSize", "8000"));
|
||||
DEFAULT_KEY_SIZE = Integer.parseInt(System.getProperty("defaultKeySize", "80"));
|
||||
DEFAULT_BIN_SIZE= Integer.parseInt(System.getProperty("defaultBinSize", "128"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,10 @@ class HashPageInfo {
|
|||
return this.size;
|
||||
}
|
||||
|
||||
boolean isEmpty() {
|
||||
return size <= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param size the size to set
|
||||
*/
|
||||
|
|
|
@ -59,7 +59,7 @@ public class KahaReferenceStoreAdapter extends KahaPersistenceAdapter implements
|
|||
private static final Log LOG = LogFactory.getLog(KahaReferenceStoreAdapter.class);
|
||||
private static final String STORE_STATE = "store-state";
|
||||
private static final String INDEX_VERSION_NAME = "INDEX_VERSION";
|
||||
private static final Integer INDEX_VERSION = new Integer(4);
|
||||
private static final Integer INDEX_VERSION = new Integer(5);
|
||||
private static final String RECORD_REFERENCES = "record-references";
|
||||
private static final String TRANSACTIONS = "transactions-state";
|
||||
private MapContainer stateMap;
|
||||
|
|
Loading…
Reference in New Issue