Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added some synchronisation
orbiterd58788b7530b
diff --git a/source/de/anomic/plasma/plasmaCrawlLURL.java b/source/de/anomic/plasma/plasmaCrawlLURL.javaindex 1d482122c..63c042843 100644--- a/source/de/anomic/plasma/plasmaCrawlLURL.java+++ b/source/de/anomic/plasma/plasmaCrawlLURL.java@@ -421,6 +421,7 @@ public final class plasmaCrawlLURL extends plasmaURL {// - int: # of outlinks to same domain// - int: # of outlinks to outside domain// - ETag: for re-crawl decision upon HEAD request+ // - int: # of keywordspublic Entry(URL url, String descr, Date moddate, Date loaddate, String referrerHash, int copyCount, boolean localNeed, int quality, String language, char doctype, int size, int wordCount) {// create new entry and store it into databasediff --git a/source/de/anomic/plasma/plasmaCrawlProfile.java b/source/de/anomic/plasma/plasmaCrawlProfile.javaindex e4e7108f9..236073cf8 100644--- a/source/de/anomic/plasma/plasmaCrawlProfile.java+++ b/source/de/anomic/plasma/plasmaCrawlProfile.java@@ -403,35 +403,42 @@ public class plasmaCrawlProfile {profileTable.set(handle(), mem);}public void domInc(String domain, String referrer, int depth) {- DomProfile dp = (DomProfile) doms.get(domain);- if (dp == null) {- // new domain- doms.put(domain, new DomProfile(referrer, depth));- } else {- // increase counter- dp.inc();- doms.put(domain, dp);+ synchronized (domain.intern()) {+ DomProfile dp = (DomProfile) doms.get(domain);+ if (dp == null) {+ // new domain+ doms.put(domain, new DomProfile(referrer, depth));+ } else {+ // increase counter+ dp.inc();+ doms.put(domain, dp);+ }}domsCache.put(this.mem.get("handle"), doms);}public boolean grantedDomAppearance(String domain) {int max = domFilterDepth();if (max == Integer.MAX_VALUE) return true;- DomProfile dp = (DomProfile) doms.get(domain);- if (dp == null) {- return 0 < max;- } else {- return dp.depth < max;+ synchronized (domain.intern()) {+ DomProfile dp = (DomProfile) doms.get(domain);+ if (dp == null) {+ return 0 < max;+ } else {+ return dp.depth < max;+ }}}+public boolean grantedDomCount(String domain) {int max = domMaxPages();if (max == Integer.MAX_VALUE) return true;- DomProfile dp = (DomProfile) doms.get(domain);- if (dp == null) {- return 0 < max;- } else {- return dp.count < max;+ synchronized (domain.intern()) {+ DomProfile dp = (DomProfile) doms.get(domain);+ if (dp == null) {+ return 0 < max;+ } else {+ return dp.count < max;+ }}}public int domSize() {diff --git a/source/de/anomic/plasma/plasmaWordIndexEntry.java b/source/de/anomic/plasma/plasmaWordIndexEntry.javaindex b99b3780d..60c49b677 100644--- a/source/de/anomic/plasma/plasmaWordIndexEntry.java+++ b/source/de/anomic/plasma/plasmaWordIndexEntry.java@@ -241,7 +241,6 @@ public final class plasmaWordIndexEntry implements Cloneable {// more needed attributes:// - boolean: appearance attributes: title, appears in header, anchor-descr, image-tag etc// - boolean: URL attributes- // - int: # of keywordsif ((language == null) || (language.length() != plasmaURL.urlLanguageLength)) language = "uk";this.urlHash = urlHash;