|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.store.AbstractStore<K,V,T>
voldemort.store.AbstractStorageEngine<ByteArray,byte[],byte[]>
voldemort.store.configuration.FileBackedCachingStorageEngine
public class FileBackedCachingStorageEngine
A Storage Engine used to persist the keys and values in a human readable format on disk. The data is primarily served off of the cache. After each put, the entire cache state is flushed to the backing file. The data is UTF-8 serialized when writing to the file in order to make it human readable. The primary purpose of this storage engine is for maintaining the cluster metadata which is characterized by low QPS and not latency sensitive.
Constructor Summary | |
---|---|
FileBackedCachingStorageEngine(java.lang.String name,
java.lang.String inputDirectory)
|
Method Summary | |
---|---|
java.lang.String |
cacheGet(java.lang.String key)
|
boolean |
delete(ByteArray key,
Version version)
Delete all entries prior to the given version |
ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> |
entries()
Get an iterator over pairs of entries in the store. |
ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> |
entries(int partition)
Get an iterator over pairs of entries in a store's partition. |
java.util.List<Versioned<byte[]>> |
get(ByteArray key,
byte[] transforms)
Get the value associated with the given key |
java.util.Map<ByteArray,java.util.List<Versioned<byte[]>>> |
getAll(java.lang.Iterable<ByteArray> keys,
java.util.Map<ByteArray,byte[]> transforms)
Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values. |
java.lang.Object |
getCapability(StoreCapabilityType capability)
Get some capability of the store. |
java.util.List<Version> |
getVersions(ByteArray key)
Get the versions associated with the given key. |
ClosableIterator<ByteArray> |
keys()
Get an iterator over keys in the store. |
ClosableIterator<ByteArray> |
keys(int partition)
Get an iterator over keys in the store's partition Note that the iterator need not be threadsafe, and that it must be manually closed after use. |
void |
put(ByteArray key,
Versioned<byte[]> value,
byte[] transforms)
Associate the value with the key and version in this store |
void |
truncate()
Truncate all entries in the store |
Methods inherited from class voldemort.store.AbstractStorageEngine |
---|
beginBatchModifications, endBatchModifications, getAndLock, isPartitionAware, isPartitionScanSupported, multiVersionPut, putAndUnlock, releaseLock, resolveAndConstructVersionsToPersist |
Methods inherited from class voldemort.store.AbstractStore |
---|
close, delete, get, getAll, getName, put |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface voldemort.store.Store |
---|
close, delete, get, getAll, getName, put |
Constructor Detail |
---|
public FileBackedCachingStorageEngine(java.lang.String name, java.lang.String inputDirectory)
Method Detail |
---|
public java.lang.Object getCapability(StoreCapabilityType capability)
Store
getCapability
in interface Store<ByteArray,byte[],byte[]>
getCapability
in class AbstractStore<ByteArray,byte[],byte[]>
capability
- The capability type to retrieve
public ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> entries()
StorageEngine
entries
in interface StorageEngine<ByteArray,byte[],byte[]>
entries
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
public ClosableIterator<ByteArray> keys()
StorageEngine
keys
in interface StorageEngine<ByteArray,byte[],byte[]>
keys
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
public void truncate()
StorageEngine
truncate
in interface StorageEngine<ByteArray,byte[],byte[]>
truncate
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
public java.util.List<Versioned<byte[]>> get(ByteArray key, byte[] transforms) throws VoldemortException
Store
get
in interface Store<ByteArray,byte[],byte[]>
get
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to check for
VoldemortException
public java.lang.String cacheGet(java.lang.String key)
public java.util.Map<ByteArray,java.util.List<Versioned<byte[]>>> getAll(java.lang.Iterable<ByteArray> keys, java.util.Map<ByteArray,byte[]> transforms) throws VoldemortException
Store
getAll
in interface Store<ByteArray,byte[],byte[]>
getAll
in class AbstractStore<ByteArray,byte[],byte[]>
keys
- The keys to check for.
VoldemortException
public java.util.List<Version> getVersions(ByteArray key)
Store
getVersions
in interface Store<ByteArray,byte[],byte[]>
getVersions
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to retrieve the versions for
public void put(ByteArray key, Versioned<byte[]> value, byte[] transforms) throws VoldemortException
Store
put
in interface Store<ByteArray,byte[],byte[]>
put
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to usevalue
- The value to store and its version.
VoldemortException
public boolean delete(ByteArray key, Version version) throws VoldemortException
Store
delete
in interface Store<ByteArray,byte[],byte[]>
delete
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to deleteversion
- The current value of the key
VoldemortException
public ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> entries(int partition)
StorageEngine
entries
in interface StorageEngine<ByteArray,byte[],byte[]>
entries
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
partition
- partition whose entries are to be fetched
public ClosableIterator<ByteArray> keys(int partition)
StorageEngine
keys
in interface StorageEngine<ByteArray,byte[],byte[]>
keys
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
partition
- partition whose keys are to be fetched
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |