fixed problem with cluster routing

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3684 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent a6fb4abb75
commit e602436fda

@ -131,6 +131,7 @@ public class natLib {
public static boolean isProper(String ip) {
plasmaSwitchboard sb=plasmaSwitchboard.getSwitchboard();
if (sb != null) {
if (sb.isRobinsonMode()) return true;
String yacyDebugMode = sb.getConfig("yacyDebugMode", "false");
if (yacyDebugMode.equals("true")) {
return true;

@ -211,7 +211,7 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
int globalContributions = rcContainers.size();
// finished searching
log.logFine("SEARCH TIME AFTER GLOBAL-TRIGGER TO " + fetchpeers + " PEERS: " + ((System.currentTimeMillis() - start) / 1000) + " seconds");
log.logFine("SEARCH TIME AFTER GLOBAL-TRIGGER TO " + primarySearchThreads.length + " PEERS: " + ((System.currentTimeMillis() - start) / 1000) + " seconds");
// combine the result and order
result = orderFinal(rcLocal);

@ -1227,6 +1227,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
this.dhtTransferChunk = null;
this.dhtTransferIndexCount = (int) getConfigLong(INDEX_DIST_CHUNK_SIZE_START, 50);
// init robinson cluster
this.clusterhashes = yacyCore.seedDB.clusterHashes(getConfig("cluster.peers.yacydomain", ""));
// deploy threads
log.logConfig("Starting Threads");
// System.gc(); // help for profiler
@ -1280,9 +1283,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
this.dbImportManager = new dbImportManager(this);
// init robinson cluster
this.clusterhashes = yacyCore.seedDB.clusterHashes(getConfig("cluster.peers.yacydomain", ""));
log.logConfig("Finished Switchboard Initialization");
}

@ -384,7 +384,7 @@ public class yacyCore {
public void run() {
try {
this.added = yacyClient.publishMySeed(seed.getPublicAddress(), seed.hash);
this.added = yacyClient.publishMySeed(seed.getClusterAddress(), seed.hash);
if (this.added < 0) {
// no or wrong response, delete that address
log.logInfo("publish: disconnected " + this.seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + this.seed.getName() + "' from " + this.seed.getPublicAddress());
@ -430,20 +430,24 @@ public class yacyCore {
// getting a list of peers to contact
if (seedDB.mySeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN).equals(yacySeed.PEERTYPE_VIRGIN)) {
if (attempts > peerPingInitial) { attempts = peerPingInitial; }
seeds = seedDB.seedsByAge(true, attempts + 10); // best for fast connection
Map ch = plasmaSwitchboard.getSwitchboard().clusterhashes;
seeds = seedDB.seedsByAge(true, attempts - ((ch == null) ? 0 : ch.size())); // best for fast connection
// add also all peers from cluster if this is a public robinson cluster
if (plasmaSwitchboard.getSwitchboard().clusterhashes != null) {
Iterator i = plasmaSwitchboard.getSwitchboard().clusterhashes.entrySet().iterator();
Iterator i = ch.entrySet().iterator();
String hash;
Map.Entry entry;
yacySeed seed;
while (i.hasNext()) {
entry = (Map.Entry) i.next();
hash = (String) entry.getKey();
if (seeds.containsKey(hash)) continue;
seed = seedDB.get(hash);
seed = (yacySeed) seeds.get(hash);
if (seed == null) {
seed = seedDB.get(hash);
if (seed == null) continue;
}
seed.setAlternativeAddress((String) entry.getValue());
seeds.put(hash, seed);
seeds.put(hash, seed);
}
}
} else {
@ -504,7 +508,7 @@ public class yacyCore {
seed = (yacySeed) seedList.remove(0);
if (seed == null) continue;
final String address = seed.getPublicAddress();
final String address = seed.getClusterAddress();
log.logFine("HELLO #" + i + " to peer '" + seed.get(yacySeed.NAME, "") + "' at " + address); // debug
if ((address == null) || (seed.isProper() != null)) {
// we don't like that address, delete it

@ -396,8 +396,7 @@ public class yacySeed {
// if (this.hash.equals("xxxxxxxxxxxx")) return "192.168.100.1:3300";
final String port = (String) this.dna.get(yacySeed.PORT);
if (port == null) { return null; }
if (port.length() < 2) { return null; }
if ((port == null) || (port.length() < 2)) return null;
return ip + ":" + port;
}
@ -407,13 +406,10 @@ public class yacySeed {
// alternativeIP object set to a local ip
// if this is present and the public ip of this peer is identical to the public ip of the own seed,
// construct an address using this ip; othervise return the public address
if ((this.alternativeIP == null) ||
(yacyCore.seedDB == null) ||
(!(this.getIP().equals(yacyCore.seedDB.mySeed.getIP())))) return getPublicAddress();
if (this.alternativeIP == null) return getPublicAddress();
final String port = (String) this.dna.get(yacySeed.PORT);
if (port == null) { return null; }
if (port.length() < 2) { return null; }
if ((port == null) || (port.length() < 2)) return null;
return this.alternativeIP + ":" + port;
}

@ -1,12 +1,11 @@
http://212.46.126.104/yacy/seed.txt
http://breyvogel.gmxhome.de/seed.txt
http://de.geocities.com/d15511z/yacy/angel/seed.txt
http://home.arcor.de/hermens/yacy/seed.txt
http://low.audioattack.de/yacy/seed.txt
http://sam-daheim.de/seed.txt
http://thq.homeip.net/share/seed.txt
http://www.dortmund.homelinux.org/~samba/yacy/seed.txt
http://www.lulabad.de/seed.txt
http://www.nkcells.info/yacyseed/seed.txt
http://www.suma-lab.de/yacy/seed.txt
http://www.tc-world.de/seed.txt
http://www.yacy.net/yacy/seed.txt

Loading…
Cancel
Save