Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Small corrections to dhtFlushControl() - Test wCacheMaxChunk against maxURLinCache(), not getMaxWordCount(). This triggered a flush everytime dhtFlushControl() was called. - If triggered, flush at least 1 entry.

hermens8f9d65da6724
diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java
index c51746636..bf16f3c00 100644
--- a/source/de/anomic/plasma/plasmaWordIndex.java
+++ b/source/de/anomic/plasma/plasmaWordIndex.java
@@ -155,10 +155,11 @@ public final class plasmaWordIndex implements indexRI {
public void dhtFlushControl(indexRAMRI theCache) {
// check for forced flush
synchronized (theCache) {
- if ((theCache.getMaxWordCount() > wCacheMaxChunk ) ||
+ if ((theCache.maxURLinCache() > wCacheMaxChunk ) ||
(theCache.size() > theCache.getMaxWordCount()) ||
(serverMemory.available() < collections.minMem())) {
- flushCache(theCache, theCache.size() + flushsize - theCache.getMaxWordCount());
+ int count = theCache.size() + flushsize - theCache.getMaxWordCount();
+ flushCache(theCache, (count > 0) ? count : 1);
}
}
}