Author: toad
Date: 2006-08-04 17:52:26 +0000 (Fri, 04 Aug 2006)
New Revision: 9887

Modified:
   trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
Allow 24 hours for startup if the store must be slow-shrinked.

Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2006-08-04 
17:41:42 UTC (rev 9886)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2006-08-04 
17:52:26 UTC (rev 9887)
@@ -8,6 +8,8 @@
 import java.util.HashSet;
 import java.util.Vector;

+import org.tanukisoftware.wrapper.WrapperManager;
+
 import com.sleepycat.bind.tuple.TupleBinding;
 import com.sleepycat.bind.tuple.TupleInput;
 import com.sleepycat.bind.tuple.TupleOutput;
@@ -235,7 +237,7 @@
        private void maybeShrink(boolean dontCheck, boolean offline) throws 
DatabaseException, IOException {
                if(chkBlocksInStore <= maxChkBlocks) return;
                if(offline)
-                       maybeSlowShrink(dontCheck);
+                       maybeSlowShrink(dontCheck, offline);
                else {
                        if(chkBlocksInStore * 0.9 > maxChkBlocks) {
                                Logger.error(this, "Doing quick and 
indiscriminate online shrink. Offline shrinks will preserve the LRU, this 
doesn't.");
@@ -246,7 +248,7 @@
                }
        }

-       private void maybeSlowShrink(boolean dontCheck) throws 
DatabaseException, IOException {
+       private void maybeSlowShrink(boolean dontCheck, boolean inStartUp) 
throws DatabaseException, IOException {
                Vector wantedKeep = new Vector(); // keep; content is wanted, 
and is in the right place
                Vector unwantedIgnore = new Vector(); // ignore; content is not 
wanted, and is not in the right place
                Vector wantedMove = new Vector(); // content is wanted, but is 
in the wrong part of the store
@@ -257,6 +259,9 @@

        long newSize = maxChkBlocks;
        if(chkBlocksInStore < maxChkBlocks) return;
+       
+       WrapperManager.signalStarting(24*60*60*1000);
+       
        System.err.println("Shrinking from "+chkBlocksInStore+" to 
"+maxChkBlocks);

        try {


Reply via email to