Author: j16sdiz
Date: 2008-07-14 14:29:46 +0000 (Mon, 14 Jul 2008)
New Revision: 21137

Modified:
   
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
Log:
resize datastore on node initialization

Modified: 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
===================================================================
--- 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
   2008-07-14 14:29:26 UTC (rev 21136)
+++ 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
   2008-07-14 14:29:46 UTC (rev 21137)
@@ -134,7 +134,16 @@
                shutdownHook.addEarlyJob(new Thread(new ShutdownDB()));

                cleanerThread = new Cleaner();
-               
+               // finish all resizing before continue
+               if (prevStoreSize != 0 && cleanerGlobalLock.tryLock()) {
+                       System.out.println("Resizing datastore (" + name + "), 
see freenet-latest.log for progress.");
+                       try {
+                               cleanerThread.resizeStore(prevStoreSize, false);
+                       } finally {
+                               cleanerGlobalLock.unlock();
+                       }
+               }
+
                cleanerThread.start();
        }



Reply via email to