Author: orbiter
Date: 2006-03-14 00:23:45 +0100 (Tue, 14 Mar 2006)
New Revision: 1885

Modified:
   trunk/source/de/anomic/plasma/plasmaWordIndex.java
Log:
removed cache flush in case of DHT receive

Modified: trunk/source/de/anomic/plasma/plasmaWordIndex.java
===================================================================
--- trunk/source/de/anomic/plasma/plasmaWordIndex.java  2006-03-13 23:06:06 UTC 
(rev 1884)
+++ trunk/source/de/anomic/plasma/plasmaWordIndex.java  2006-03-13 23:23:45 UTC 
(rev 1885)
@@ -134,30 +134,22 @@
         ramCache.setMaxWordCount(maxWords);
     }
 
-    public void flushControl(boolean dhtCase) {
+    public void flushControl() {
         // check for forced flush
         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);
+        }
+        if (ramCache.wSize() > ramCache.getMaxWordCount()) {
+            while (ramCache.wSize() + 500 > ramCache.getMaxWordCount()) {
                 flushCache(1);
             }
-            if (ramCache.wSize() > ramCache.getMaxWordCount()) {
-                while (ramCache.wSize() + 500 > ramCache.getMaxWordCount()) {
-                    flushCache(1);
-                }
-            }
         }
     }
 
     public boolean addEntry(String wordHash, plasmaWordIndexEntry entry, long 
updateTime, boolean dhtCase) {
         if (ramCache.addEntry(wordHash, entry, updateTime, dhtCase)) {
-            flushControl(dhtCase);
+            if (!dhtCase) flushControl();
             return true;
         }
         return false;
@@ -167,7 +159,7 @@
         int added = ramCache.addEntries(entries, updateTime, dhtCase);
 
         // force flush
-        flushControl(dhtCase);
+        if (!dhtCase) flushControl();
         return added;
     }
 

_______________________________________________
YaCy-svn mailing list
[email protected]
http://lists.berlios.de/mailman/listinfo/yacy-svn

Antwort per Email an