From 0e9a99cb055575c315ec3c85b733239e67c12f05 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 30 May 2011 07:51:18 +0000 Subject: [PATCH] another resource hack git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7758 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/search/TextSnippet.java | 7 ++----- source/de/anomic/yacy/graphics/WebStructureGraph.java | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/search/TextSnippet.java b/source/de/anomic/search/TextSnippet.java index a179bdbfc..01a72171b 100644 --- a/source/de/anomic/search/TextSnippet.java +++ b/source/de/anomic/search/TextSnippet.java @@ -82,16 +82,13 @@ public class TextSnippet implements Comparable, Comparator cache; public Cache() { - cache = new ConcurrentARC(maxCache, Math.max(10, Runtime.getRuntime().availableProcessors())); + cache = new ConcurrentARC(maxCache, Math.max(32, 4 * Runtime.getRuntime().availableProcessors())); } public void put(final String wordhashes, final String urlhash, final String snippet) { // generate key final String key = urlhash + wordhashes; - // do nothing if snippet is known - if (cache.containsKey(key)) return; - - // learn new snippet + // do nothing if snippet is known or learn new snippet cache.insertIfAbsent(key, snippet); } diff --git a/source/de/anomic/yacy/graphics/WebStructureGraph.java b/source/de/anomic/yacy/graphics/WebStructureGraph.java index 1153ce909..7b10318df 100644 --- a/source/de/anomic/yacy/graphics/WebStructureGraph.java +++ b/source/de/anomic/yacy/graphics/WebStructureGraph.java @@ -178,7 +178,7 @@ public class WebStructureGraph { if (nexturlhashb != null) { nexturlhash = ASCII.String(nexturlhashb); assert nexturlhash.length() == 12 : "nexturlhash.length() = " + nexturlhash.length() + ", nexturlhash = " + nexturlhash; - assert !nexturlhash.substring(6).equals(refhashp); + //assert !nexturlhash.substring(6).equals(refhashp); // this is a global link cpg.append(nexturlhash); // store complete hash assert cpg.length() % 12 == 0 : "cpg.length() = " + cpg.length() + ", cpg = " + cpg.toString();