[count:int][value-length:int][value:bytes][value-length:int][value:bytes]... +-----------value 1------------+-----------value 2-----------+
06/06, 2011 - Added support for Closeable 06/25, 2011 - Added constructor using StoreConfig
809810811812813814815
* @param config - DataSet configuration * @return A fixed-capacity DataSet. * @throws Exception if the set cannot be created. */ public static StaticDataSet createStaticDataSet(StoreConfig config) throws Exception { return new StaticDataSet(config); }
903904905906907908909910911912913
int batchSize, int numSyncBatches, int segmentFileSizeMB, SegmentFactory segmentFactory, double segmentCompactFactor) throws Exception { return new StaticDataSet( homeDir, capacity, batchSize, numSyncBatches, segmentFileSizeMB,
3233343536373839404142
*/ public class TestStaticDataSetApi extends AbstractTestDataSetApi { @Override protected DataSet<byte[]> createStore(File homeDir) throws Exception { return new StaticDataSet( homeDir, 10000, /* capacity */ 100, /* batchSize */ 5, /* numSyncBatches */ Segment.minSegmentFileSizeMB,
33343536373839
} protected abstract HashFunction<byte[]> createHashFunction(); protected StaticDataSet createDataSet(File storeDir, int capacity, HashFunction<byte[]> hashFunction) throws Exception { return new StaticDataSet(storeDir, capacity, 10000, 5, 32, new MemorySegmentFactory(), hashFunction); }
888990919293949596979899100101102
HashFunction<byte[]> hashFunction = createHashFunction(); File storeHomeDir = getHomeDirectory(); int storeCapacity = (int)(_keyCount * 1.5); StaticDataSet store = createDataSet(storeHomeDir, storeCapacity, hashFunction); StatsLog.logger.info(">>> populate"); populate(store); store.sync(); StatsLog.logger.info(">>> collect collision stats"); collect(store); cleanTestOutput();
39404142434445
protected SegmentFactory createSegmentFactory() { return new MemorySegmentFactory(); } protected StaticDataSet createDataSet(File storeDir, int capacity, SegmentFactory segmentFactory, HashFunction<byte[]> hashFunction) throws Exception { return new StaticDataSet(storeDir, capacity, 10000, 5, 32, segmentFactory, hashFunction); }
3839404142434445464748
} @Override protected DataSet<byte[]> getDataSet(File storeDir) throws Exception { int capacity = (int)(_keyCount * 1.5); return new StaticDataSet(storeDir, capacity, /* capacity */ 10000, /* entrySize */ 5, /* maxEntries */ _segFileSizeMB, getSegmentFactory());