diff --git a/source/de/anomic/plasma/plasmaCrawlLURL.java b/source/de/anomic/plasma/plasmaCrawlLURL.java index 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 keywords public 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 database diff --git a/source/de/anomic/plasma/plasmaCrawlProfile.java b/source/de/anomic/plasma/plasmaCrawlProfile.java index 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.java index 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 keywords if ((language == null) || (language.length() != plasmaURL.urlLanguageLength)) language = "uk"; this.urlHash = urlHash;