enhancement in synchronisation

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7525 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent bcea497644
commit f2e8ffd768

@ -393,16 +393,18 @@ public final class SearchEvent {
if (oldAbstract == null) {
// new abstracts in the cache
abstractsCache.put(wordhash, singleAbstract);
} else synchronized (oldAbstract) {
} else {
// extend the abstracts in the cache: join the single abstracts
for (final Map.Entry<String, String> oneref: singleAbstract.entrySet()) {
final String urlhash = oneref.getKey();
final String peerlistNew = oneref.getValue();
final String peerlistOld = oldAbstract.get(urlhash);
if (peerlistOld == null) {
oldAbstract.put(urlhash, peerlistNew);
} else {
oldAbstract.put(urlhash, peerlistOld + peerlistNew);
synchronized (oldAbstract) {
final String peerlistOld = oldAbstract.get(urlhash);
if (peerlistOld == null) {
oldAbstract.put(urlhash, peerlistNew);
} else {
oldAbstract.put(urlhash, peerlistOld + peerlistNew);
}
}
}
// abstractsCache.put(wordhash, oldAbstract);

@ -443,12 +443,16 @@ public class yacySeed implements Cloneable, Comparable<yacySeed>, Comparator<yac
*/
public final String getPublicAddress() {
String ip = this.getIP();
if (ip == null || ip.length() < 8) ip = "localhost";
if (ip == null || ip.length() < 8 || ip.length() > 60) ip = "localhost";
final String port = this.dna.get(yacySeed.PORT);
if ((port == null) || (port.length() < 2)) return null;
if (port == null || port.length() < 2 || port.length() > 5) return null;
return ip + ":" + port;
StringBuilder sb = new StringBuilder(ip.length() + port.length() + 1);
sb.append(ip);
sb.append(':');
sb.append(port);
return sb.toString();
}
/**

Loading…
Cancel
Save