git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@605940 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-12-20 14:29:30 +00:00
parent de14440109
commit 1d7b88431a
4 changed files with 9 additions and 9 deletions

View File

@ -115,7 +115,7 @@ public abstract class AbstractSubscription implements Subscription {
}
public boolean isSlave() {
return getContext().isSlave();
return broker.getBrokerService().isSlave();
}
public ConnectionContext getContext() {

View File

@ -143,9 +143,6 @@ class HashBin {
}
}
if (!replace) {
if (low > size()) {
LOG.info("SIZE() " + size() + " low = " + low);
}
addHashEntry(low, newEntry);
size++;
}
@ -189,7 +186,6 @@ class HashBin {
pageToUse.setPage(hp);
offset = 0;
} else {
int count = 0;
int countSoFar=0;
int pageNo = 0;
@ -206,10 +202,14 @@ class HashBin {
countSoFar += page.size();
pageNo++;
}
while(pageNo >= hashPages.size()) {
HashPage hp = hashIndex.createPage(id);
addHashPageInfo(hp.getId(), 0);
}
pageToUse = hashPages.get(pageNo);
}
pageToUse.begin();
pageToUse.addHashEntry(offset, entry);
doOverFlow(index);
}

View File

@ -62,7 +62,7 @@ public class HashIndex implements Index {
private AtomicBoolean loaded = new AtomicBoolean();
private LRUCache<Long, HashPage> pageCache;
private boolean enablePageCaching=true;
private int pageCacheSize = 1;
private int pageCacheSize = 10;
/**

View File

@ -88,7 +88,7 @@ class HashPageInfo {
void begin() throws IOException {
if (page == null) {
page = hashIndex.getFullPage(id);
page = hashIndex.lookupPage(id);
}
}