From a47bdc405b42c09ae50f7d5feaaa429b46508f5f Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 5 Apr 2011 08:04:25 +0000 Subject: [PATCH] better logging for robinson selection according to peer tag git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7645 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/yacy/dht/PeerSelection.java | 9 +++++++-- source/de/anomic/yacy/yacySeed.java | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/yacy/dht/PeerSelection.java b/source/de/anomic/yacy/dht/PeerSelection.java index 819e6cd89..76afc443c 100755 --- a/source/de/anomic/yacy/dht/PeerSelection.java +++ b/source/de/anomic/yacy/dht/PeerSelection.java @@ -122,8 +122,9 @@ public class PeerSelection { while (dhtEnum.hasNext()) { seed = dhtEnum.next(); if (seed == null) continue; + if (seed.getFlagAcceptRemoteIndex()) continue; if (seed.isLastSeenTimeout(3600000)) continue; - if (!seed.getFlagAcceptRemoteIndex()) robinson.add(seed); + robinson.add(seed); } // add robinson peers according to robinson burst rate @@ -150,7 +151,11 @@ public class PeerSelection { if (seed.matchPeerTags(wordhashes)) { // peer tags match String specialized = seed.getPeerTags().toString(); - if (!specialized.equals("[*]")) Log.logInfo("DHT", "selectPeers/PeerTags: " + seed.hash + ":" + seed.getName() + ", is specialized peer for " + specialized); + if (specialized.equals("[*]")) { + Log.logInfo("DHT", "selectPeers/RobinsonTag: " + seed.hash + ":" + seed.getName() + " grants search for all"); + } else { + Log.logInfo("DHT", "selectPeers/RobinsonTag " + seed.hash + ":" + seed.getName() + " is specialized peer for " + specialized); + } regularSeeds.put(seed.hash, seed); } } diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.java index 7f28dda5b..417c26856 100644 --- a/source/de/anomic/yacy/yacySeed.java +++ b/source/de/anomic/yacy/yacySeed.java @@ -553,7 +553,8 @@ public class yacySeed implements Cloneable, Comparable, Comparator milliseconds; + long d = Math.abs(System.currentTimeMillis() - this.getLastSeenUTC()); + return d > milliseconds; } /** @return the age of the seed in number of days */