Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fixed problem with cluster routing

orbitere602436fda64
diff --git a/source/de/anomic/net/natLib.java b/source/de/anomic/net/natLib.java
index ed00ec366..7f3fc9ee0 100644
--- a/source/de/anomic/net/natLib.java
+++ b/source/de/anomic/net/natLib.java
@@ -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;
diff --git a/source/de/anomic/plasma/plasmaSearchEvent.java b/source/de/anomic/plasma/plasmaSearchEvent.java
index a3a297e9d..b1ff9fb56 100644
--- a/source/de/anomic/plasma/plasmaSearchEvent.java
+++ b/source/de/anomic/plasma/plasmaSearchEvent.java
@@ -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);
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index 253df403c..a11d3bec4 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -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");
}
diff --git a/source/de/anomic/yacy/yacyCore.java b/source/de/anomic/yacy/yacyCore.java
index c4f90e96c..2b5179d06 100644
--- a/source/de/anomic/yacy/yacyCore.java
+++ b/source/de/anomic/yacy/yacyCore.java
@@ -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
diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.java
index 5fe9caa0a..28c2e59a6 100644
--- a/source/de/anomic/yacy/yacySeed.java
+++ b/source/de/anomic/yacy/yacySeed.java
@@ -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;
}
diff --git a/superseed.txt b/superseed.txt
index 974805e68..7402dbd66 100644
--- a/superseed.txt
+++ b/superseed.txt
@@ -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