From 74f6fd229e4c49c25f89767e1b072e875de09ec3 Mon Sep 17 00:00:00 2001 From: lotus Date: Thu, 22 Jul 2010 08:12:58 +0000 Subject: [PATCH] some comments + debug code git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6985 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/yacy/dht/Dispatcher.java | 12 +++++++----- .../anomic/yacy/dht/VerticalWordPartitionScheme.java | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/yacy/dht/Dispatcher.java b/source/de/anomic/yacy/dht/Dispatcher.java index d9cce6257..15687ff40 100755 --- a/source/de/anomic/yacy/dht/Dispatcher.java +++ b/source/de/anomic/yacy/dht/Dispatcher.java @@ -278,7 +278,7 @@ public class Dispatcher { ByteArray pTArray; Transmission.Chunk entry; for (int vertical = 0; vertical < containers.length; vertical++) { - // the 'new' primary target is the word hash of the last container + // the 'new' primary target is the word hash of the last container in the array lastContainer = containers[vertical].get(containers[vertical].size() - 1); primaryTarget = FlatWordPartitionScheme.positionToHash(this.seeds.scheme.dhtPosition(lastContainer.getTermHash(), vertical)); assert primaryTarget[2] != '@'; @@ -294,13 +294,15 @@ public class Dispatcher { this.log.logInfo("enqueueContainers: selected " + targets.size() + " targets for primary target key " + new String(primaryTarget) + "/" + vertical + " with " + containers[vertical].size() + " index containers."); if (entry == null) entry = transmission.newChunk(primaryTarget, targets, lastContainer.row()); - /*/ lookup own target + /*/ lookup targets int sc = 1; for (yacySeed seed : targets) { - if(seed == seeds.mySeed()) - this.log.logInfo("enqueueContainers: myself-target at position " + sc); + if(seed == null) continue; + if(seed == seeds.mySeed()) this.log.logInfo("enqueueContainers: myself-target at position " + sc); + this.log.logInfo("enqueueContainers: primaryTarget distance at position " + sc + ": " + FlatWordPartitionScheme.std.dhtDistance(primaryTarget, null, seed)); + this.log.logInfo("enqueueContainers: distance to first container at position " + sc + ": " + FlatWordPartitionScheme.std.dhtDistance(FlatWordPartitionScheme.positionToHash(this.seeds.scheme.dhtPosition(containers[vertical].get(0).getTermHash(), vertical)), null, seed)); sc++; - } */ + }*/ // fill the entry with the containers for (ReferenceContainer c: containers[vertical]) { diff --git a/source/de/anomic/yacy/dht/VerticalWordPartitionScheme.java b/source/de/anomic/yacy/dht/VerticalWordPartitionScheme.java index e089da43a..1a6c9aa22 100755 --- a/source/de/anomic/yacy/dht/VerticalWordPartitionScheme.java +++ b/source/de/anomic/yacy/dht/VerticalWordPartitionScheme.java @@ -48,7 +48,7 @@ public class VerticalWordPartitionScheme implements PartitionScheme { * and the urls are not spread over all positions of the DHT. To use this effect, the * horizontal DHT position must be normed to a 'rest' value of a partition size * This method is compatible to the classic DHT computation as always one of the vertical - * DHT position corresponds to the classic position. + * DHT position corresponds to the classic horizontal position. * @param wordHash, the hash of the RWI * @param partitions, the number of partitions should be computed with partitions = 2**n, n = scaling factor * @param urlHash, the hash of a reference