fix for remote search process

pull/1/head
Michael Peter Christen 11 years ago
parent 0843b12ef3
commit 97995a1dd9

@ -123,7 +123,7 @@ public class ConcurrentUpdateSolrConnector implements SolrConnector {
@Override
public int bufferSize() {
return this.updateCapacity;
return this.docBuffer.size();
}
@Override

@ -503,8 +503,10 @@ public final class Protocol {
final long timestamp = System.currentTimeMillis();
event.addExpectedRemoteReferences(count);
SearchResult result;
String clusteraddress = target.getPublicAddress(target.getIP());
SearchResult result = null;
for (String ip: target.getIPs()) {
if (ip.indexOf(':') >= 0) System.out.println("Search target: IPv6: " + ip);
String clusteraddress = target.getPublicAddress(ip);
if (target.clash(event.peers.mySeed().getIPs())) clusteraddress = "localhost:" + event.peers.mySeed().getPort();
try {
result =
@ -526,9 +528,10 @@ public final class Protocol {
);
} catch (final IOException e ) {
Network.log.info("SEARCH failed, Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")");
event.peers.peerActions.peerDeparture(target, "search request to peer created io exception: " + e.getMessage());
event.peers.peerActions.interfaceDeparture(target, ip);
return -1;
}
}
// computation time
final long totalrequesttime = System.currentTimeMillis() - timestamp;

@ -174,7 +174,6 @@ public class RemoteSearch extends Thread {
dhtPeers = DHTSelection.selectClusterPeers(event.peers, clusterselection);
} else {
if (event.query.getQueryGoal().isCatchall() || event.query.getQueryGoal().getIncludeHashes().has(Segment.catchallHash)) {
if (event.query.modifier.sitehost != null && event.query.modifier.sitehost.length() > 0) {
// select peers according to host name, not the query goal
String newGoal = Domains.getSmartSLD(event.query.modifier.sitehost);
@ -186,10 +185,9 @@ public class RemoteSearch extends Thread {
random);
} else {
// select just random peers
dhtPeers = DHTSelection.seedsByAge(event.peers, false, count).values();
}
dhtPeers = DHTSelection.seedsByAge(event.peers, false, event.peers.redundancy()).values();
}
} else {
dhtPeers = DHTSelection.selectDHTSearchTargets(
event.peers,
event.query.getQueryGoal().getIncludeHashes(),
@ -207,6 +205,7 @@ public class RemoteSearch extends Thread {
for (int i = 0; i < targetSize; i++) dhtPeers.add(pa.remove(random.nextInt(pa.size())));
}
}
}
if (dhtPeers == null) dhtPeers = new HashSet<Seed>();
// select node targets

@ -140,9 +140,7 @@ public class serverAccessTracker {
track.add(new Track(System.currentTimeMillis(), accessPath));
clearTooOldAccess(track);
}
if (Domains.isLocalhost(host)) lastLocalhostAccess = System.currentTimeMillis(); else {
System.out.println("******** Access not from localhost: " + host);
}
if (Domains.isLocalhost(host)) lastLocalhostAccess = System.currentTimeMillis();
}
public static Collection<Track> accessTrack(final String host) {

Loading…
Cancel
Save