Author: toad
Date: 2007-06-19 17:19:15 +0000 (Tue, 19 Jun 2007)
New Revision: 13654

Modified:
   trunk/freenet/src/freenet/node/GlobalProbe.java
   trunk/freenet/src/freenet/node/NodeDispatcher.java
   trunk/freenet/src/freenet/node/ProbeCallback.java
   trunk/freenet/src/freenet/node/TextModeClientInterface.java
Log:
Log the best-not-taken-so-far locs

Modified: trunk/freenet/src/freenet/node/GlobalProbe.java
===================================================================
--- trunk/freenet/src/freenet/node/GlobalProbe.java     2007-06-19 16:54:46 UTC 
(rev 13653)
+++ trunk/freenet/src/freenet/node/GlobalProbe.java     2007-06-19 17:19:15 UTC 
(rev 13654)
@@ -30,8 +30,8 @@
                                }
                        }

-                       public void onTrace(long uid, double target, double 
nearest, double best, short htl, short counter, double location, long nodeUID, 
double[] peerLocs, long[] peerUIDs) {
-                               String msg = "Probe trace: UID="+uid+" 
target="+target+" nearest="+nearest+" best="+best+" htl="+htl+" 
counter="+counter+" location="+location+" node UID="+nodeUID+" peer 
locs="+StringArray.toString(peerLocs)+" peer 
UIDs="+StringArray.toString(peerUIDs);
+                       public void onTrace(long uid, double target, double 
nearest, double best, short htl, short counter, double location, long nodeUID, 
double[] peerLocs, long[] peerUIDs, double[] locsNotVisited) {
+                               String msg = "Probe trace: UID="+uid+" 
target="+target+" nearest="+nearest+" best="+best+" htl="+htl+" 
counter="+counter+" location="+location+" node UID="+nodeUID+" peer 
locs="+StringArray.toString(peerLocs)+" peer 
UIDs="+StringArray.toString(peerUIDs)+" locs not visited: 
"+StringArray.toString(locsNotVisited);
                                Logger.error(this, msg);
                        }
        };

Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeDispatcher.java  2007-06-19 16:54:46 UTC 
(rev 13653)
+++ trunk/freenet/src/freenet/node/NodeDispatcher.java  2007-06-19 17:19:15 UTC 
(rev 13654)
@@ -737,7 +737,12 @@
                long nodeUID = msg.getLong(DMT.MY_UID);
                double[] peerLocs = 
Fields.bytesToDoubles(((ShortBuffer)msg.getObject(DMT.PEER_LOCATIONS)).getData());
                long[] peerUIDs = 
Fields.bytesToLongs(((ShortBuffer)msg.getObject(DMT.PEER_UIDS)).getData());
-               ctx.cb.onTrace(uid, target, nearest, best, htl, counter, 
location, nodeUID, peerLocs, peerUIDs);
+               Message notVisited = 
msg.getSubMessage(DMT.FNPBestRoutesNotTaken);
+               double[] locsNotVisited = null;
+               if(notVisited != null) {
+                       locsNotVisited = 
Fields.bytesToDoubles(((ShortBuffer)notVisited.getObject(DMT.BEST_LOCATIONS_NOT_VISITED)).getData());
+               }
+               ctx.cb.onTrace(uid, target, nearest, best, htl, counter, 
location, nodeUID, peerLocs, peerUIDs, locsNotVisited);
        }

        private boolean handleProbeReply(Message m, PeerNode src) {

Modified: trunk/freenet/src/freenet/node/ProbeCallback.java
===================================================================
--- trunk/freenet/src/freenet/node/ProbeCallback.java   2007-06-19 16:54:46 UTC 
(rev 13653)
+++ trunk/freenet/src/freenet/node/ProbeCallback.java   2007-06-19 17:19:15 UTC 
(rev 13654)
@@ -8,6 +8,6 @@

        void onCompleted(String reason, double target, double best, double 
nearest, long id, short counter);

-       void onTrace(long uid, double target, double nearest, double best, 
short htl, short counter, double location, long nodeUID, double[] peerLocs, 
long[] peerUIDs);
+       void onTrace(long uid, double target, double nearest, double best, 
short htl, short counter, double location, long nodeUID, double[] peerLocs, 
long[] peerUIDs, double[] locsNotVisited);

 }

Modified: trunk/freenet/src/freenet/node/TextModeClientInterface.java
===================================================================
--- trunk/freenet/src/freenet/node/TextModeClientInterface.java 2007-06-19 
16:54:46 UTC (rev 13653)
+++ trunk/freenet/src/freenet/node/TextModeClientInterface.java 2007-06-19 
17:19:15 UTC (rev 13654)
@@ -831,8 +831,8 @@
                                        }
                                }

-                               public void onTrace(long uid, double target, 
double nearest, double best, short htl, short counter, double location, long 
nodeUID, double[] peerLocs, long[] peerUIDs) {
-                                       String msg = "Probe trace: UID="+uid+" 
target="+target+" nearest="+nearest+" best="+best+" htl="+htl+" 
counter="+counter+" location="+location+"node UID="+nodeUID+" peer 
locs="+StringArray.toString(peerLocs)+" peer 
UIDs="+StringArray.toString(peerUIDs);
+                               public void onTrace(long uid, double target, 
double nearest, double best, short htl, short counter, double location, long 
nodeUID, double[] peerLocs, long[] peerUIDs, double[] locsNotVisited) {
+                                       String msg = "Probe trace: UID="+uid+" 
target="+target+" nearest="+nearest+" best="+best+" htl="+htl+" 
counter="+counter+" location="+location+"node UID="+nodeUID+" peer 
locs="+StringArray.toString(peerLocs)+" peer 
UIDs="+StringArray.toString(peerUIDs)+" locs not visited = 
"+StringArray.toString(locsNotVisited);
                                        System.err.println(msg);
                                }
                };


Reply via email to