Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added some synchronization to avoid that several tasks can trigger a cache flush simultanously
orbiterf9063e2040b5
diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.javaindex 543a4b703..93af2cf02 100644--- a/source/de/anomic/plasma/plasmaWordIndex.java+++ b/source/de/anomic/plasma/plasmaWordIndex.java@@ -139,7 +139,7 @@ public final class plasmaWordIndex {return added;}- private void flushCacheToBackend(String wordHash) {+ private synchronized void flushCacheToBackend(String wordHash) {plasmaWordIndexEntryContainer c = ramCache.deleteContainer(wordHash);plasmaWordIndexEntryContainer feedback = assortmentCluster.storeTry(wordHash, c);if (feedback != null) {@@ -188,7 +188,7 @@ public final class plasmaWordIndex {return ((long) microDateDays) * ((long) day);}- public int addPageIndex(URL url, String urlHash, Date urlModified, int size, plasmaCondenser condenser, String language, char doctype) {+ public synchronized int addPageIndex(URL url, String urlHash, Date urlModified, int size, plasmaCondenser condenser, String language, char doctype) {// this is called by the switchboard to put in a new page into the index// use all the words in one condenser object to simultanous create index entries@@ -330,7 +330,7 @@ public final class plasmaWordIndex {backend.close(10);}- public void deleteIndex(String wordHash) {+ public synchronized void deleteIndex(String wordHash) {ramCache.deleteContainer(wordHash);assortmentCluster.removeFromAll(wordHash, -1);backend.deleteIndex(wordHash);diff --git a/source/de/anomic/plasma/plasmaWordIndexDistribution.java b/source/de/anomic/plasma/plasmaWordIndexDistribution.javaindex ab76ad736..9dab724d9 100644--- a/source/de/anomic/plasma/plasmaWordIndexDistribution.java+++ b/source/de/anomic/plasma/plasmaWordIndexDistribution.java@@ -195,7 +195,7 @@ public final class plasmaWordIndexDistribution {return -1;}- // send away the indexes to all these indexes+ // send away the indexes to all these peersString peerNames = "";int hc1 = 0;plasmaDHTTransfer transfer = null;