From b9add5cf37328a62fa49fed479fd3b23109c7ba0 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 2 May 2007 14:20:43 +0000 Subject: [PATCH] some bugfixes: - dht iterator start point - wordIndex synchronization - surftipps url check git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3633 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Surftips.java | 1 + source/de/anomic/plasma/plasmaDHTFlush.java | 4 ++-- source/de/anomic/plasma/plasmaWordIndex.java | 10 +++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/htroot/Surftips.java b/htroot/Surftips.java index 98370d7a0..10e4313bf 100644 --- a/htroot/Surftips.java +++ b/htroot/Surftips.java @@ -226,6 +226,7 @@ public class Surftips { if (record.category().equals(yacyNewsPool.CATEGORY_PROFILE_UPDATE)) { url = record.attribute("homepage", ""); + if ((url == null) || (url.length() < 12)) continue; entry = rowdef.newEntry(new byte[][]{ url.getBytes(), ("Home Page of " + record.attribute("nickname", "")).getBytes("UTF-8"), diff --git a/source/de/anomic/plasma/plasmaDHTFlush.java b/source/de/anomic/plasma/plasmaDHTFlush.java index 48ed25801..dca80fab2 100644 --- a/source/de/anomic/plasma/plasmaDHTFlush.java +++ b/source/de/anomic/plasma/plasmaDHTFlush.java @@ -153,7 +153,7 @@ public class plasmaDHTFlush extends Thread { public void performTransferWholeIndex() { plasmaDHTChunk newDHTChunk = null, oldDHTChunk = null; try { - // initial startingpoint of intex transfer is "------------" + // initial startingpoint of intex transfer is "AAAAAAAAAAAA" this.log.logFine("Selected hash " + this.startPointHash + " as start point for index distribution of whole index"); /* Loop until we have @@ -178,7 +178,7 @@ public class plasmaDHTFlush extends Thread { if (nothingSelected(newDHTChunk)) { if (this.sb.wordIndex.size() > 0 && this.delete) { // if there are still words in the index we try it again now - this.startPointHash = "------------"; + this.startPointHash = "AAAAAAAAAAAA"; } else { // otherwise we could end transfer now this.log.logFine("No index available for index transfer, hash start-point " + this.startPointHash); diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index df7db109d..461120589 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -199,12 +199,8 @@ public final class plasmaWordIndex implements indexRI { } public void flushCacheSome() { - synchronized (dhtOutCache) { - flushCache(dhtOutCache, (dhtOutCache.size() > 3 * flushsize) ? flushsize : Math.min(flushsize, Math.max(1, dhtOutCache.size() / lowcachedivisor))); - } - synchronized (dhtInCache) { - flushCache(dhtInCache, (dhtInCache.size() > 3 * flushsize) ? flushsize : Math.min(flushsize, Math.max(1, dhtInCache.size() / lowcachedivisor))); - } + flushCache(dhtOutCache, (dhtOutCache.size() > 3 * flushsize) ? flushsize : Math.min(flushsize, Math.max(1, dhtOutCache.size() / lowcachedivisor))); + flushCache(dhtInCache, (dhtInCache.size() > 3 * flushsize) ? flushsize : Math.min(flushsize, Math.max(1, dhtInCache.size() / lowcachedivisor))); } private void flushCache(indexRAMRI ram, int count) { @@ -214,7 +210,7 @@ public final class plasmaWordIndex implements indexRI { busyCacheFlush = true; String wordHash; ArrayList containerList = new ArrayList(); - synchronized (this) { + synchronized (ram) { boolean collectMax = true; indexContainer c; while (collectMax) {