Update of /cvsroot/freenet/freenet/src/freenet/node In directory sc8-pr-cvs1:/tmp/cvs-serv25916/src/freenet/node
Modified Files: SmartFailureTable.java FailureTable.java Log Message: initial commit Index: SmartFailureTable.java =================================================================== RCS file: /cvsroot/freenet/freenet/src/freenet/node/SmartFailureTable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- SmartFailureTable.java 28 Oct 2003 17:25:40 -0000 1.1 +++ SmartFailureTable.java 28 Oct 2003 17:35:04 -0000 1.2 @@ -9,11 +9,7 @@ import freenet.support.sort.QuickSorter; -import java.util.Hashtable; -import java.util.Date; - -import java.util.Enumeration; -import java.util.Random; +import java.util.*; import java.io.PrintWriter; @@ -24,6 +20,11 @@ public class SmartFailureTable extends FailureTable { final int treshold; + /** + * reuse the constructor + * @param treshold - the number of hits before the key + * is marked irrelevant to pDNF calculation + */ public SmartFailureTable(int size, int treshold){ super(size,-1); //keys don't expire, do they? this.treshold = treshold; @@ -32,4 +33,16 @@ public synchronized void checkpoint() { //override and do nothing, keys don't expire } + + //contains a list of FailureEntries, doesn't extend it, aggregates it instead. + private class ExtendedFailureEntry { + Key key; + LinkedList history; + public ExtendedFailureEntry(Key key, int hopsToLive, long time) { + this.key = key; + history = new LinkedList(); + history.add(new FailureEntry(key, hopsToLive, time)); + } + } + } Index: FailureTable.java =================================================================== RCS file: /cvsroot/freenet/freenet/src/freenet/node/FailureTable.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -r1.11 -r1.12 --- FailureTable.java 1 Jan 2003 09:54:36 -0000 1.11 +++ FailureTable.java 28 Oct 2003 17:35:04 -0000 1.12 @@ -196,7 +196,7 @@ } - private class FailureEntry extends Element { + protected class FailureEntry extends Element { private int hopsToLive; private Key key; private long time; _______________________________________________ cvs mailing list [EMAIL PROTECTED] http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs