krati.store
Class IndexedDataStore

java.lang.Object
  extended by krati.store.IndexedDataStore
All Implemented Interfaces:
Iterable<Map.Entry<byte[],byte[]>>, DataStore<byte[],byte[]>

public class IndexedDataStore
extends Object
implements DataStore<byte[],byte[]>

IndexedDataStore.

Author:
jwu

Constructor Summary
IndexedDataStore(File homeDir, int batchSize, int numSyncBatches, int indexInitLevel, int indexSegmentFileSizeMB, SegmentFactory indexSegmentFactory, int storeInitLevel, int storeSegmentFileSizeMB, SegmentFactory storeSegmentFactory)
           
IndexedDataStore(File homeDir, int batchSize, int numSyncBatches, SegmentFactory indexSegmentFactory, SegmentFactory storeSegmentFactory)
           
 
Method Summary
 void clear()
           
 boolean delete(byte[] key)
           
 byte[] get(byte[] key)
           
 File getIndexHome()
           
 File getStoreHome()
           
 Iterator<Map.Entry<byte[],byte[]>> iterator()
           
 Iterator<byte[]> keyIterator()
           
 void persist()
           
 boolean put(byte[] key, byte[] value)
           
 void sync()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedDataStore

public IndexedDataStore(File homeDir,
                        int batchSize,
                        int numSyncBatches,
                        SegmentFactory indexSegmentFactory,
                        SegmentFactory storeSegmentFactory)
                 throws Exception
Throws:
Exception

IndexedDataStore

public IndexedDataStore(File homeDir,
                        int batchSize,
                        int numSyncBatches,
                        int indexInitLevel,
                        int indexSegmentFileSizeMB,
                        SegmentFactory indexSegmentFactory,
                        int storeInitLevel,
                        int storeSegmentFileSizeMB,
                        SegmentFactory storeSegmentFactory)
                 throws Exception
Throws:
Exception
Method Detail

getIndexHome

public final File getIndexHome()

getStoreHome

public final File getStoreHome()

get

public byte[] get(byte[] key)
Specified by:
get in interface DataStore<byte[],byte[]>

put

public boolean put(byte[] key,
                   byte[] value)
            throws Exception
Specified by:
put in interface DataStore<byte[],byte[]>
Throws:
Exception

delete

public boolean delete(byte[] key)
               throws Exception
Specified by:
delete in interface DataStore<byte[],byte[]>
Throws:
Exception

clear

public void clear()
           throws IOException
Specified by:
clear in interface DataStore<byte[],byte[]>
Throws:
IOException

persist

public void persist()
             throws IOException
Specified by:
persist in interface DataStore<byte[],byte[]>
Throws:
IOException

sync

public void sync()
          throws IOException
Specified by:
sync in interface DataStore<byte[],byte[]>
Throws:
IOException

keyIterator

public Iterator<byte[]> keyIterator()
Specified by:
keyIterator in interface DataStore<byte[],byte[]>

iterator

public Iterator<Map.Entry<byte[],byte[]>> iterator()
Specified by:
iterator in interface Iterable<Map.Entry<byte[],byte[]>>


Copyright © 2011. All Rights Reserved.