Update of /cvsroot/freenet/freenet/src/freenet/node/states/announcement
In directory sc8-pr-cvs1:/tmp/cvs-serv32518/src/freenet/node/states/announcement

Modified Files:
        AnnouncementDone.java AnnouncementState.java 
        CompletePending.java ExecutePending.java LastNode.java 
        NewAnnouncement.java ReplyPending.java 
Log Message:
6163: Merge NGRouting
* Routing table switch: new config option routingTableImpl - "classic" or "ng"
* New diagnostics variables: normalizedSuccessTime, successSearchTime, 
successTransferRate, requestSuccessRatio, requestFailureRoutingOrNotRatio, 
routingSuccessRatio. These are reported by both RT modes, so should be usable for 
comparative purposes.
* Significant changes to Node Status Servlet, including a page with several graphs for 
each node in the RT.
* Significant changes to ConnectionOpener. Fixes to races that were causing 
RouteNotFound errors, a toString(), much more and better logging.
* Make a distinction between failed caching a DataReply due to IOE in the store and 
due to IOE on the stream when caching a DataReply. Use this in the code to make sure 
we respond correctly w.r.t. routing (it's more important in NGRouting).
* RoutingTable.route() now takes extra params: HTL, size, whether it is an insert. 
Added reportConnectionSuccess, reportConnectionFailure, used by ConnectionOpener to 
tell RT about connections.
* Major changes to the existing ResponseTimeEstimator class. Changed logic, changed 
serialization, changed interface, just about everything. Now implements the generic 
TimeEstimator, knows about time versus transfer rate versus probability, wraps around 
properly, has some significant algorithm changes.
* Change Routing interface significantly. Several new me methods, old ones have been 
given new arguments. Caller must for stats eventually call terminate(), or another 
terminal method (transferSuccess, dataNotFound). New base class, TerminatableRouting 
(implements Routing, base of NGRouting and TreeRouting), handles most of the stats.
* Add code all over states/ (mostly request, but also the others) for notifying the 
Routing of timings and status, terminating the Routing, some reporting bugfixes, get 
rid of the old "NGROUTING" debug log diagnostics.
* Lots of completely new code for NGRouting, mostly in freenet/node/rt/



Misc fixes etc
* Fix a deadlock in ConnectionHandler
* Iakin fix for 1.4.2 and later changed static initialization behaviour w.r.t. 
Core.params.
* Added messageSuccessRatio, tracks proportion of messages successfully sent
* Fix some NullPointerExceptions
* Spelling fixes to descriptions of diagnostic variables by Edward J. Huff
* Fixes to AbstractSelectorLoop.queueClose*, connection close notifications were being 
missed.
* Catch all throwables thrown by process() processing maintenance queue

Minor/future
* Notes on inserts (attacks, NGRouting)
* Give the ref to the GPL on the RNF page a filename
* Even more logging improvements
* More minor reindenting/restyling


Index: AnnouncementDone.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcement/AnnouncementDone.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AnnouncementDone.java       2 Nov 2002 22:44:40 -0000       1.2
+++ AnnouncementDone.java       30 Aug 2003 23:16:53 -0000      1.3
@@ -12,8 +12,9 @@
 
     public AnnouncementDone(AnnouncementState st) {
         super(st);
+       terminateRouting(false, false);
     }
-
+    
     public String getName() {
         return "Announcement Done";
     }

Index: AnnouncementState.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcement/AnnouncementState.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AnnouncementState.java      22 May 2003 18:14:20 -0000      1.4
+++ AnnouncementState.java      30 Aug 2003 23:16:53 -0000      1.5
@@ -134,6 +134,13 @@
             } catch (IOException e) {}
         }
     }
+    
+    public void terminateRouting(boolean success, boolean routingRelated) {
+       if(routes != null) {
+           routes.terminate(success, routingRelated);
+           routes = null;
+       }
+    }
 }
 
 

Index: CompletePending.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcement/CompletePending.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CompletePending.java        26 Jul 2003 21:36:29 -0000      1.7
+++ CompletePending.java        30 Aug 2003 23:16:53 -0000      1.8
@@ -40,7 +40,8 @@
          
         // insert into Routing table
         n.reference(k, announcee);
-        
+
+        terminateRouting(false, false);
         // since we have added the reference
         return new AnnouncementDone(this);
     }
@@ -124,7 +125,7 @@
             n.logger.log(this, "Failed to send AnnouncementComplete",
                          e, n.logger.MINOR);
         }
-
+       terminateRouting(false, false);
         // since we've added the ref
         return new AnnouncementDone(this);
     }

Index: ExecutePending.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcement/ExecutePending.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ExecutePending.java 30 Jun 2003 14:32:42 -0000      1.3
+++ ExecutePending.java 30 Aug 2003 23:16:53 -0000      1.4
@@ -60,6 +60,7 @@
                          e, Logger.DEBUG);
         }
 
+       terminateRouting(false, false);
         return new AnnouncementDone(this);
     }
 
@@ -75,7 +76,8 @@
             n.logger.log(this, "Failed to send QueryAborted after no Execute",
                          e, Logger.DEBUG);
         }
-
+       
+       terminateRouting(false, false);
         return new AnnouncementDone(this);
     }
 
@@ -101,6 +103,7 @@
                 return cp.received(n, nc);
             }
         } else {
+           terminateRouting(false, false);
             QueryAborted qa = new QueryAborted(id);
             AnnouncementFailed af = 
                 new AnnouncementFailed(id,

Index: LastNode.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/announcement/LastNode.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- LastNode.java       26 Jul 2003 21:36:29 -0000      1.7
+++ LastNode.java       30 Aug 2003 23:16:53 -0000      1.8
@@ -15,6 +15,7 @@
 
     public LastNode(AnnouncementState as, NoExecute ne) {
         super(as, ne, bCopy(as.myVal));
+       terminateRouting(false, false);
     }
 
     private static byte[] bCopy(byte[] b) {

Index: NewAnnouncement.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcement/NewAnnouncement.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- NewAnnouncement.java        26 Jul 2003 21:36:29 -0000      1.9
+++ NewAnnouncement.java        30 Aug 2003 23:16:53 -0000      1.10
@@ -160,11 +160,11 @@
                 (byte) (l >> 24), (byte) (l >> 32), (byte) (l >> 40), 
                 (byte) (l >> 48), (byte) (l >> 56)
             });
-            routes = n.rt.route(k, false);
+            routes = n.rt.route(k, hopsToLive, 0, false, false);
         }
-
+       
         routed++;
-
+       
         while (routed < MAX_ROUTING_TIMES) { // routed does not change in loop
            if(n.logger.shouldLog(Logger.DEBUG))
                n.logger.log(this, "Trying to route "+Fields.longToHex(id)+
@@ -183,14 +183,15 @@
                n.logger.log(this, "Forwarding query ("+Fields.longToHex(id)+
                             ") to: "+nr, Logger.DEBUG);
             try {
-                n.sendMessage(na, nr, n.routeConnectTimeout);
-                routes.routeConnected();
+               ConnectionHandler ch = 
+                   n.makeConnection(nr, n.routeConnectTimeout);
+               routes.routeConnected(ch.isCached());
+               ch.sendMessage(na);
                 
                 lastAddr = n.getPeer(nr);
                 NoReply nrm = new NoReply(id);
                 n.schedule(getTime(1), nrm);
                 return new ReplyPending(this, nrm);
-                
             } catch (AuthenticationFailedException e) {
                 //routes.routeConnected();
                 routes.authFailed();

Index: ReplyPending.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcement/ReplyPending.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ReplyPending.java   19 Apr 2003 15:32:55 -0000      1.7
+++ ReplyPending.java   30 Aug 2003 23:16:53 -0000      1.8
@@ -53,7 +53,8 @@
             n.logger.log(this, "Failed to forward " + qa +": "+e,
                          Logger.MINOR);
         }
-
+       
+       terminateRouting(false, false);
         return new AnnouncementDone(this);
     }
 
@@ -86,6 +87,7 @@
 
             routes.timedOut();
             if (!sendQueryRestarted(n, new QueryRestarted(id))) {
+               terminateRouting(false, false);
                 return new AnnouncementDone(this);
             }
             try {
@@ -114,6 +116,7 @@
         nr.cancel();
 
         if (!sendQueryRestarted(n, new QueryRestarted(id))) {
+           terminateRouting(false, false);
             return new AnnouncementDone(this);
         }
             
@@ -132,11 +135,11 @@
         nr = new NoReply(id);
         n.schedule(getTime(hopsToLive), nr);
 
-        if (!sendQueryRestarted(n, qr))
+        if (!sendQueryRestarted(n, qr)) {
+           terminateRouting(false, false);
             return new AnnouncementDone(this);
-        else
+       } else
             return this;
-        
     }
 
     public State receivedMessage(Node n, AnnouncementFailed af) 
@@ -152,6 +155,7 @@
             n.logger.log(this, "Failed to send AnnouncementFailed",
                          e, n.logger.MINOR);
         }
+       terminateRouting(false, false);
         return new AnnouncementDone(this);
     }
 

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to