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
pull/1/head
orbiter 14 years ago
parent cafcb1f9ed
commit a47bdc405b

@ -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);
}
}

@ -553,7 +553,8 @@ public class yacySeed implements Cloneable, Comparable<yacySeed>, Comparator<yac
* @return true, if the time between the last-seen time and now is greater then the given time-out
*/
public final boolean isLastSeenTimeout(long milliseconds) {
return Math.abs(System.currentTimeMillis() - this.getLastSeenUTC()) > milliseconds;
long d = Math.abs(System.currentTimeMillis() - this.getLastSeenUTC());
return d > milliseconds;
}
/** @return the age of the seed in number of days */

Loading…
Cancel
Save