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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6949 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 1557e0f2d0
commit bf25407fdd

@ -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";

@ -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";
}

@ -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);

@ -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 {

@ -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;
}

Loading…
Cancel
Save