Package krati.store

Examples of krati.store.StaticDataStore


        super(TestIteratorStaticDataStore.class.getSimpleName());
    }
   
    protected DataStore<byte[], byte[]> createDataStore(File storeDir) throws Exception {
        int capacity = (int)(_keyCount * 1.5);
        return new StaticDataStore(storeDir,
                                   capacity, /* capacity */
                                   10000,    /* batchSize */
                                   5,        /* numSyncBatches */
                                   _segFileSizeMB,
                                   createSegmentFactory());
View Full Code Here


*/
public class TestStaticDataStoreApi extends AbstractTestDataStoreApi {

    @Override
    protected DataStore<byte[], byte[]> createStore(File homeDir) throws Exception {
        return new StaticDataStore(
                homeDir,
                10000, /* capacity */
                100,   /* batchSize */
                5,     /* numSyncBatches */
                32,    /* segmentFileSizeMB */
 
View Full Code Here

   
    public void testMaxCapacity() throws Exception {
        StoreConfig config = new StoreConfig(getHomeDir(), Integer.MAX_VALUE);
        config.setIndexesCached(false); // Do not cache indexes in memory
       
        StaticDataStore store = StoreFactory.createStaticDataStore(config);
       
        // Check store capacity
        assertEquals(Integer.MAX_VALUE, store.capacity());
        assertEquals(Integer.MAX_VALUE, store.getDataArray().length());
       
        store.close();
    }
View Full Code Here

     * @param config - DataStore configuration
     * @return A fixed-capacity DataStore.
     * @throws Exception if the store cannot be created.
     */
    public static StaticDataStore createStaticDataStore(StoreConfig config) throws Exception {
        return new StaticDataStore(config);
    }
View Full Code Here

            int batchSize,
            int numSyncBatches,
            int segmentFileSizeMB,
            SegmentFactory segmentFactory,
            double segmentCompactFactor) throws Exception {
        return new StaticDataStore(
                homeDir,
                capacity,
                batchSize,
                numSyncBatches,
                segmentFileSizeMB,
View Full Code Here

*/
public class TestStaticDataStoreIterator extends AbstractTestDataStoreIterator {
   
    @Override
    protected DataStore<byte[], byte[]> createStore(File homeDir) throws Exception {
        return new StaticDataStore(
                homeDir,
                10000, /* capacity */
                100,   /* batchSize */
                5,     /* numSyncBatches */
                32,    /* segmentFileSizeMB */
 
View Full Code Here

    }
   
    @Override
    protected DataStore<byte[], byte[]> getDataStore(File storeDir) throws Exception {
        int capacity = (int)(_keyCount * 1.5);
        return new StaticDataStore(storeDir,
                                   capacity, /* capacity */
                                   10000,    /* entrySize */
                                   10,       /* maxEntries */
                                   _segFileSizeMB,
                                   getSegmentFactory());
View Full Code Here

    protected SegmentFactory getSegmentFactory() {
        return new krati.core.segment.MemorySegmentFactory();
    }
   
    protected DataStore<byte[], byte[]> getDataStore(File storeDir, int capacity) throws Exception {
        return new StaticDataStore(storeDir,
                                   capacity,
                                   1000,      /* entrySize */
                                   5,         /* maxEntries */
                                   _segFileSizeMB,
                                   getSegmentFactory());
View Full Code Here

TOP

Related Classes of krati.store.StaticDataStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.