removed cache flush in case of DHT receive

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1885 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent e94b374d56
commit f588c0724f

@ -134,16 +134,9 @@ public final class plasmaWordIndex {
ramCache.setMaxWordCount(maxWords); ramCache.setMaxWordCount(maxWords);
} }
public void flushControl(boolean dhtCase) { public void flushControl() {
// check for forced flush // check for forced flush
ramCache.shiftK2W(); ramCache.shiftK2W();
if (dhtCase) {
if (ramCache.wSize() > ramCache.getMaxWordCount()) {
while (ramCache.wSize() + 500 > ramCache.getMaxWordCount()) {
flushCache(1);
}
}
} else {
while (ramCache.maxURLinWCache() > plasmaWordIndexCache.wCacheReferenceLimit) { while (ramCache.maxURLinWCache() > plasmaWordIndexCache.wCacheReferenceLimit) {
flushCache(1); flushCache(1);
} }
@ -153,11 +146,10 @@ public final class plasmaWordIndex {
} }
} }
} }
}
public boolean addEntry(String wordHash, plasmaWordIndexEntry entry, long updateTime, boolean dhtCase) { public boolean addEntry(String wordHash, plasmaWordIndexEntry entry, long updateTime, boolean dhtCase) {
if (ramCache.addEntry(wordHash, entry, updateTime, dhtCase)) { if (ramCache.addEntry(wordHash, entry, updateTime, dhtCase)) {
flushControl(dhtCase); if (!dhtCase) flushControl();
return true; return true;
} }
return false; return false;
@ -167,7 +159,7 @@ public final class plasmaWordIndex {
int added = ramCache.addEntries(entries, updateTime, dhtCase); int added = ramCache.addEntries(entries, updateTime, dhtCase);
// force flush // force flush
flushControl(dhtCase); if (!dhtCase) flushControl();
return added; return added;
} }

Loading…
Cancel
Save