From f588c0724f576132abaf1a38af064ceaea0fe6d2 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 13 Mar 2006 23:23:45 +0000 Subject: [PATCH] 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 --- source/de/anomic/plasma/plasmaWordIndex.java | 24 +++++++------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index 2a0ae6d2c..0ffafc48a 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -134,30 +134,22 @@ public final class plasmaWordIndex { 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 @@ public final class plasmaWordIndex { int added = ramCache.addEntries(entries, updateTime, dhtCase); // force flush - flushControl(dhtCase); + if (!dhtCase) flushControl(); return added; }