diff --git a/build.properties b/build.properties index 349357d70..ce88e8a6b 100644 --- a/build.properties +++ b/build.properties @@ -3,7 +3,7 @@ javacSource=1.5 javacTarget=1.5 # Release Configuration -releaseVersion=0.83 +releaseVersion=0.84 stdReleaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz embReleaseFile=yacy_emb_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz proReleaseFile=yacy_pro_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz diff --git a/source/de/anomic/crawler/CrawlProfile.java b/source/de/anomic/crawler/CrawlProfile.java index f6c579fc6..f9364105f 100644 --- a/source/de/anomic/crawler/CrawlProfile.java +++ b/source/de/anomic/crawler/CrawlProfile.java @@ -29,6 +29,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; import de.anomic.kelondro.blob.BLOBHeap; @@ -58,7 +59,7 @@ public class CrawlProfile { return s; } - static HashMap> domsCache = new HashMap>(); + static HashMap> domsCache = new HashMap>(); MapView profileTable; private final File profileTableFile; @@ -278,7 +279,7 @@ public class CrawlProfile { public static final String XPSTOPW = "xpstopw"; Map mem; - private Map doms; + private ConcurrentHashMap doms; private Pattern mustmatch = null, mustnotmatch = null; @@ -316,7 +317,7 @@ public class CrawlProfile { mem.put(XDSTOPW, Boolean.toString(xdstopw)); // exclude dynamic stop-word mem.put(XPSTOPW, Boolean.toString(xpstopw)); // exclude parent stop-words - doms = new HashMap(); + doms = new ConcurrentHashMap(); } public String toString() { @@ -332,7 +333,7 @@ public class CrawlProfile { public entry(final Map mem) { this.mem = mem; this.doms = domsCache.get(this.mem.get(HANDLE)); - if (this.doms == null) this.doms = new HashMap(); + if (this.doms == null) this.doms = new ConcurrentHashMap(); } public Map map() { @@ -462,41 +463,35 @@ public class CrawlProfile { return (r.equals(Boolean.TRUE.toString())); } public void domInc(final String domain, final String referrer, final int depth) { - synchronized (domain.intern()) { - final DomProfile dp = doms.get(domain); - if (dp == null) { - // new domain - doms.put(domain, new DomProfile(referrer, depth)); - } else { - // increase counter - dp.inc(); - doms.put(domain, dp); - } + final DomProfile dp = 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(final String domain) { final int max = domFilterDepth(); if (max == Integer.MAX_VALUE) return true; - synchronized (domain.intern()) { - final DomProfile dp = doms.get(domain); - if (dp == null) { - return 0 < max; - } - return dp.depth <= max; + final DomProfile dp = doms.get(domain); + if (dp == null) { + return 0 < max; } + return dp.depth <= max; } public boolean grantedDomCount(final String domain) { final int max = domMaxPages(); if (max == Integer.MAX_VALUE) return true; - synchronized (domain.intern()) { - final DomProfile dp = doms.get(domain); - if (dp == null) { - return 0 < max; - } - return dp.count <= max; + final DomProfile dp = doms.get(domain); + if (dp == null) { + return 0 < max; } + return dp.count <= max; } public int domSize() { return doms.size();