Update of /cvsroot/freenet/freenet/src/freenet/node/rt
In directory sc8-pr-cvs1:/tmp/cvs-serv10464/src/freenet/node/rt
Modified Files:
NGRouting.java Routing.java TreeRouting.java
Log Message:
Implement secondary failure table. If a request comes in that has failed twice, and
the highest fail HTL is >= the request HTL, set a flag on it to ignore DNF; the result
of this is that the estimators are not told about the DNF, and the stats get it as a
non-routing-related failure.
Index: NGRouting.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/NGRouting.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -r1.16 -r1.17
--- NGRouting.java 1 Nov 2003 15:13:35 -0000 1.16
+++ NGRouting.java 1 Nov 2003 22:35:33 -0000 1.17
@@ -24,6 +24,8 @@
boolean desperate = false;
boolean doDesperate;
boolean logDEBUG;
+ boolean ignoreDNF = false;
+ boolean ignoreThisResult = false;
Node node;
boolean hasSearchFailed = false;
long origStartTime;
@@ -196,6 +198,11 @@
}
protected void reallyTerminate(boolean success, boolean routingRelated) {
+ // Still counts in the stats, but not in the routing stats
+ if(ignoreThisResult) {
+ routingRelated = false;
+ ignoreThisResult = false;
+ }
super.reallyTerminate(success, routingRelated);
if(logDEBUG)
Core.logger.log(this, "reallyTerminating("+success+","+
@@ -224,7 +231,11 @@
public void dataNotFound(int htl) {
long now = System.currentTimeMillis();
+ if(!ignoreDNF) {
last.dataNotFound(key, now - lastTime, htl);
+ } else {
+ ignoreThisResult = true;
+ }
lastTime = now;
terminate(false, true);
}
@@ -232,4 +243,11 @@
public String toString() {
return super.toString() + " ("+key+","+(isInsert?"insert":"request")+")";
}
+
+ /* (non-Javadoc)
+ * @see freenet.node.rt.Routing#setShouldIgnoreDNF()
+ */
+ public void setShouldIgnoreDNF() {
+ ignoreDNF = true;
+ }
}
Index: Routing.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/Routing.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -r1.9 -r1.10
--- Routing.java 30 Oct 2003 01:34:06 -0000 1.9
+++ Routing.java 1 Nov 2003 22:35:34 -0000 1.10
@@ -126,6 +126,12 @@
* any network activity i.e. it's been used to determine which ref
* to send on */
void terminateNoDiagnostic();
+
+ /**
+ * Indicate that if there is a DNF, it is expected, and not to
+ * update the estimators.
+ */
+ void setShouldIgnoreDNF();
}
Index: TreeRouting.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/TreeRouting.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -w -r1.29 -r1.30
--- TreeRouting.java 31 Oct 2003 19:21:20 -0000 1.29
+++ TreeRouting.java 1 Nov 2003 22:35:34 -0000 1.30
@@ -286,6 +286,13 @@
desperate = true;
stepCount = freenet.node.Node.maxRoutingSteps+1;
}
+
+ /* (non-Javadoc)
+ * @see freenet.node.rt.Routing#setShouldIgnoreDNF()
+ */
+ public void setShouldIgnoreDNF() {
+ // We don't care
+ }
}
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs