# HG changeset patch # User Dan Creswell # Date 1246809084 -3600 # Node ID 62b11f04d859a0be2bdb375705c95e7ae66b7ac4 # Parent 4580bb12db30ca52afe044245cca1ff1e9dc09f7 Make cache partitioning configurable. diff -r 4580bb12db30 -r 62b11f04d859 src/org/dancres/blitz/entry/SleeveCache.java --- a/src/org/dancres/blitz/entry/SleeveCache.java Sun Jul 05 16:26:25 2009 +0100 +++ b/src/org/dancres/blitz/entry/SleeveCache.java Sun Jul 05 16:51:24 2009 +0100 @@ -32,6 +32,7 @@ import org.dancres.blitz.config.EntryConstraints; import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicLong; +import org.dancres.blitz.config.ConfigurationFactory; /** The organization of the space implementation can be viewed as being @@ -54,7 +55,21 @@ static Logger theLogger = Logging.newLogger("org.dancres.blitz.disk.SleeveCache"); - private static final int DESIRED_ENTRIES_PER_PARTITION = 128; + private static int DESIRED_ENTRIES_PER_PARTITION = 0; + + static { + try { + DESIRED_ENTRIES_PER_PARTITION = + ((Integer) ConfigurationFactory.getEntry("cacheEntriesPerPartition", int.class, + new Integer(128))).intValue(); + + theLogger.log(Level.SEVERE, "Loaded config: " + ((Integer) ConfigurationFactory.getEntry("cacheEntriesPerPartition", int.class, + new Integer(128))).intValue()); + + } catch (ConfigurationException aCE) { + theLogger.log(Level.SEVERE, "Failed to source partition setup", aCE); + } + } private final ArcCache[] theStoreCaches; private final int theNumPartitions;