Skip to content

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

added peer hash to internal RSSFeed. The hash will be used to display news activities in the network graphic.

orbiterbf25407fdda9
diff --git a/htroot/yacy/transferRWI.java b/htroot/yacy/transferRWI.java
index 14153b35e..cb452cb01 100644
--- a/htroot/yacy/transferRWI.java
+++ b/htroot/yacy/transferRWI.java
@@ -218,8 +218,8 @@ public final class transferRWI {
String firstHash = wordhashes.get(0);
String lastHash = wordhashes.get(wordhashes.size() - 1);
final long avdist = (FlatWordPartitionScheme.std.dhtDistance(firstHash.getBytes(), null, sb.peers.mySeed()) + FlatWordPartitionScheme.std.dhtDistance(lastHash.getBytes(), null, sb.peers.mySeed())) / 2;
- sb.getLog().logInfo("Received " + received + " Entries " + wordc + " Words [" + firstHash + " .. " + lastHash + "]/" + avdist + " from " + otherPeerName + ", processed in " + (System.currentTimeMillis() - startProcess) + " milliseconds, requesting " + unknownURL.size() + "/" + receivedURL + " URLs, blocked " + blocked + " RWIs");
- RSSFeed.channels(RSSFeed.YaCyChannel.DHTRECEIVE).addMessage(new RSSMessage("Received " + received + " RWIs [" + firstHash + " .. " + lastHash + "]/" + avdist + " from " + otherPeerName + ", requesting " + unknownURL.size() + " URLs, blocked " + blocked, "", ""));
+ sb.getLog().logInfo("Received " + received + " RWIs, " + wordc + " Words [" + firstHash + " .. " + lastHash + "]/" + avdist + ", blocked " + blocked + ", requesting " + unknownURL.size() + "/" + receivedURL + " URLs from " + otherPeerName);
+ RSSFeed.channels(RSSFeed.YaCyChannel.DHTRECEIVE).addMessage(new RSSMessage("Received " + received + " RWIs, " + wordc + " Words [" + firstHash + " .. " + lastHash + "]/" + avdist + ", blocked " + blocked + ", requesting " + unknownURL.size() + "/" + receivedURL + " URLs from " + otherPeerName, "", otherPeer.hash));
}
result = "ok";
diff --git a/htroot/yacy/transferURL.java b/htroot/yacy/transferURL.java
index 7b14f8e8d..c8c222f8f 100644
--- a/htroot/yacy/transferURL.java
+++ b/htroot/yacy/transferURL.java
@@ -157,7 +157,7 @@ public final class transferURL {
final int more = sb.indexSegments.urlMetadata(Segments.Process.DHTIN).size() - sizeBefore;
doublevalues = Integer.toString(received - more);
yacyCore.log.logInfo("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, blocked " + blocked + " URLs");
- RSSFeed.channels(RSSFeed.YaCyChannel.DHTRECEIVE).addMessage(new RSSMessage("Received " + received + " URLs from peer " + otherPeerName + ", blocked " + blocked, "", ""));
+ RSSFeed.channels(RSSFeed.YaCyChannel.DHTRECEIVE).addMessage(new RSSMessage("Received " + received + ", blocked " + blocked + " URLs from peer " + otherPeerName, "", otherPeer.hash));
if ((received - more) > 0) yacyCore.log.logSevere("Received " + doublevalues + " double URLs from peer " + otherPeerName);
result = "ok";
}
diff --git a/source/de/anomic/yacy/graphics/NetworkGraph.java b/source/de/anomic/yacy/graphics/NetworkGraph.java
index b3b8f8c97..aad0eef14 100644
--- a/source/de/anomic/yacy/graphics/NetworkGraph.java
+++ b/source/de/anomic/yacy/graphics/NetworkGraph.java
@@ -188,7 +188,6 @@ public class NetworkGraph {
int count = 0;
int totalCount = 0;
Iterator<yacySeed> e = seedDB.seedsConnected(true, false, null, (float) 0.0);
-
while (e.hasNext() && count < maxCount) {
seed = e.next();
if (seed != null) {
@@ -229,6 +228,11 @@ public class NetworkGraph {
// draw my own peer
drawNetworkPicturePeer(networkPicture, width / 2, height / 2 + 20, innerradius, outerradius, seedDB.mySeed(), COL_WE_DOT, COL_WE_LINE, COL_WE_TEXT, coronaangle);
+ // draw DHT activity
+
+
+
+
// draw description
networkPicture.setColor(COL_HEADLINE);
PrintTool.print(networkPicture, 2, 8, 0, "YACY NETWORK '" + networkName.toUpperCase() + "'", -1);
diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.java
index 2ae7486b5..b8beb5d48 100644
--- a/source/de/anomic/yacy/yacyClient.java
+++ b/source/de/anomic/yacy/yacyClient.java
@@ -874,7 +874,7 @@ public final class yacyClient {
if (uhss == null) {
return "no unknownURL tag in response";
}
- RSSFeed.channels(RSSFeed.YaCyChannel.DHTSEND).addMessage(new RSSMessage("Send " + indexes.size() + " RWIs to " + targetSeed.getName(), "", ""));
+ RSSFeed.channels(RSSFeed.YaCyChannel.DHTSEND).addMessage(new RSSMessage("Sent " + indexes.size() + " RWIs to " + targetSeed.getName(), "", targetSeed.hash));
uhss = uhss.trim();
if (uhss.length() == 0 || uhss.equals(",")) { return null; } // all url's known, we are ready here
@@ -908,7 +908,7 @@ public final class yacyClient {
if (!result.equals("ok")) {
return result;
}
- RSSFeed.channels(RSSFeed.YaCyChannel.DHTSEND).addMessage(new RSSMessage("Send " + uhs.length + " URLs to peer " + targetSeed.getName(), "", ""));
+ RSSFeed.channels(RSSFeed.YaCyChannel.DHTSEND).addMessage(new RSSMessage("Sent " + uhs.length + " URLs to peer " + targetSeed.getName(), "", targetSeed.hash));
return null;
} finally {
diff --git a/source/net/yacy/cora/document/RSSFeed.java b/source/net/yacy/cora/document/RSSFeed.java
index 10453eed0..89b123a37 100644
--- a/source/net/yacy/cora/document/RSSFeed.java
+++ b/source/net/yacy/cora/document/RSSFeed.java
@@ -27,6 +27,8 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class RSSFeed implements Iterable<Hit> {
+ public static final int maxMessagesPerChannel = 200; // to avoid a memory leak
+
public static enum YaCyChannel {
TEST,
PEERNEWS,
@@ -166,7 +168,7 @@ public class RSSFeed implements Iterable<Hit> {
if (feed != null) return feed;
feed = new RSSFeed();
feed.setChannel(new RSSMessage(channel.name(), "", ""));
- feed.maxsize = 100;
+ feed.maxsize = maxMessagesPerChannel;
channels.put(channel, feed);
return feed;
}