git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@650386 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-04-22 06:03:17 +00:00
parent 16f2d753e8
commit 35635f925d
3 changed files with 5 additions and 18 deletions

View File

@ -52,7 +52,7 @@ public class HashIndex implements Index, HashIndexMBean {
private int pageSize = DEFAULT_PAGE_SIZE; private int pageSize = DEFAULT_PAGE_SIZE;
private int keySize = DEFAULT_KEY_SIZE; private int keySize = DEFAULT_KEY_SIZE;
private int numberOfBins = DEFAULT_BIN_SIZE; private int numberOfBins = DEFAULT_BIN_SIZE;
private int keysPerPage = pageSize / keySize; private int keysPerPage = this.pageSize /this.keySize;
private DataByteArrayInputStream dataIn; private DataByteArrayInputStream dataIn;
private DataByteArrayOutputStream dataOut; private DataByteArrayOutputStream dataOut;
private byte[] readBuffer; private byte[] readBuffer;
@ -62,7 +62,7 @@ public class HashIndex implements Index, HashIndexMBean {
private LinkedList<HashPage> freeList = new LinkedList<HashPage>(); private LinkedList<HashPage> freeList = new LinkedList<HashPage>();
private AtomicBoolean loaded = new AtomicBoolean(); private AtomicBoolean loaded = new AtomicBoolean();
private LRUCache<Long, HashPage> pageCache; private LRUCache<Long, HashPage> pageCache;
private boolean enablePageCaching=true; private boolean enablePageCaching=false;//this is off by default - see AMQ-1667
private int pageCacheSize = 10; private int pageCacheSize = 10;
private int size; private int size;
private int activeBins; private int activeBins;

View File

@ -46,19 +46,6 @@ class HashPage {
private long nextFreePageId = HashEntry.NOT_SET; private long nextFreePageId = HashEntry.NOT_SET;
private boolean active = true; private boolean active = true;
/**
* Constructor
*
* @param hashIndex
* @param id
* @param parentId
* @param maximumEntries
*/
HashPage(long id, int maximumEntries) {
this(maximumEntries);
this.id = id;
}
/** /**
* Constructor * Constructor

View File

@ -69,7 +69,7 @@ class HashPageInfo {
void addHashEntry(int index, HashEntry entry) throws IOException { void addHashEntry(int index, HashEntry entry) throws IOException {
page.addHashEntry(index, entry); page.addHashEntry(index, entry);
size++; size=page.size();
dirty = true; dirty = true;
} }
@ -80,7 +80,7 @@ class HashPageInfo {
HashEntry removeHashEntry(int index) throws IOException { HashEntry removeHashEntry(int index) throws IOException {
HashEntry result = page.removeHashEntry(index); HashEntry result = page.removeHashEntry(index);
if (result != null) { if (result != null) {
size--; size=page.size();
dirty = true; dirty = true;
} }
return result; return result;