Author: toad
Date: 2008-01-04 15:07:57 +0000 (Fri, 04 Jan 2008)
New Revision: 16878

Modified:
   trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
BDBFS: Remember the storeType

Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-01-04 
14:58:29 UTC (rev 16877)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-01-04 
15:07:57 UTC (rev 16878)
@@ -68,6 +68,7 @@
        final int dataBlockSize;
        final int headerBlockSize;

+       private final short storeType;
        private final Environment environment;
        private final TupleBinding storeBlockTupleBinding;
        private final File fixSecondaryFile;
@@ -190,7 +191,7 @@

                try {
                        // First try just opening it.
-                       return new BerkeleyDBFreenetStore(storeEnvironment, 
newDBPrefix, newStoreFile, newFixSecondaryFile,
+                       return new BerkeleyDBFreenetStore(type, 
storeEnvironment, newDBPrefix, newStoreFile, newFixSecondaryFile,
                                        maxStoreKeys, blockSize, headerSize, 
throwOnTooFewKeys, noCheck, wipe, storeShutdownHook, 
                                        reconstructFile);
                } catch (DatabaseException e) {
@@ -204,7 +205,7 @@
                                System.err.println("Cannot reconstruct SSK 
store/cache! Sorry, your SSK store will now be deleted...");
                                
BerkeleyDBFreenetStore.wipeOldDatabases(storeEnvironment, newDBPrefix);
                                newStoreFile.delete();
-                               return new 
BerkeleyDBFreenetStore(storeEnvironment, newDBPrefix, newStoreFile, 
newFixSecondaryFile,
+                               return new BerkeleyDBFreenetStore(type, 
storeEnvironment, newDBPrefix, newStoreFile, newFixSecondaryFile,
                                                maxStoreKeys, blockSize, 
headerSize, throwOnTooFewKeys, noCheck, wipe, storeShutdownHook, 
                                                reconstructFile);
                        }
@@ -239,8 +240,9 @@
        * @throws DatabaseException
        * @throws FileNotFoundException if the dir does not exist and could not 
be created
        */
-       private BerkeleyDBFreenetStore(Environment env, String prefix, File 
storeFile, File fixSecondaryFile, long maxChkBlocks, int blockSize, int 
headerSize, boolean throwOnTooFewKeys, boolean noCheck, boolean wipe, 
SemiOrderedShutdownHook storeShutdownHook, File reconstructFile) throws 
IOException, DatabaseException {
+       private BerkeleyDBFreenetStore(short type, Environment env, String 
prefix, File storeFile, File fixSecondaryFile, long maxChkBlocks, int 
blockSize, int headerSize, boolean throwOnTooFewKeys, boolean noCheck, boolean 
wipe, SemiOrderedShutdownHook storeShutdownHook, File reconstructFile) throws 
IOException, DatabaseException {
                logMINOR = Logger.shouldLog(Logger.MINOR, this);
+               this.storeType = type;
                this.dataBlockSize = blockSize;
                this.headerBlockSize = headerSize;
                this.freeBlocks = new SortedLongSet();
@@ -959,6 +961,7 @@
        */
        private BerkeleyDBFreenetStore(Environment env, String prefix, File 
storeFile, File fixSecondaryFile, long maxChkBlocks, int blockSize, int 
headerSize, short type, boolean noCheck, SemiOrderedShutdownHook 
storeShutdownHook, File reconstructFile) throws DatabaseException, IOException {
                logMINOR = Logger.shouldLog(Logger.MINOR, this);
+               this.storeType = type;
                this.dataBlockSize = blockSize;
                this.headerBlockSize = headerSize;
                this.freeBlocks = new SortedLongSet();


Reply via email to