|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- The type of the key being storedV
- The type of the value being storedT
- The type of the transformspublic interface StorageEngine<K,V,T>
A base storage class which is actually responsible for data persistence. This interface implies all the usual responsibilities of a Store implementation, and in addition
Method Summary | |
---|---|
boolean |
beginBatchModifications()
A lot of storage engines support efficient methods for performing large number of writes (puts/deletes) against the data source. |
boolean |
endBatchModifications()
|
ClosableIterator<Pair<K,Versioned<V>>> |
entries()
Get an iterator over pairs of entries in the store. |
ClosableIterator<Pair<K,Versioned<V>>> |
entries(int partition)
Get an iterator over pairs of entries in a store's partition. |
KeyLockHandle<V> |
getAndLock(K key)
Returns the list of versions stored for the key, at the same time locking the key for any writes until putAndUnlock(Object, KeyLockHandle) or
releaseLock(KeyLockHandle) is called with the same
lock handle. |
boolean |
isPartitionAware()
Are partitions persisted in distinct files? In other words is the data stored on disk on a per-partition basis? This is really for the read-only use case in which each partition is stored in a distinct file. |
boolean |
isPartitionScanSupported()
Does the storage engine support efficient scanning of a single partition? |
ClosableIterator<K> |
keys()
Get an iterator over keys in the store. |
ClosableIterator<K> |
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. |
java.util.List<Versioned<V>> |
multiVersionPut(K key,
java.util.List<Versioned<V>> values)
Atomically update storage with the list of versioned values for the given key, to improve storage efficiency. |
void |
putAndUnlock(K key,
KeyLockHandle<V> handle)
Takes the handle issued from a prior getAndLock(Object) call, and update the key with
the set of values provided in the handle, also releasing the lock held on
the key. |
void |
releaseLock(KeyLockHandle<V> handle)
Release any lock held by a prior AbstractStorageEngine.getAndLock(Object) call. |
void |
truncate()
Truncate all entries in the store |
Methods inherited from interface voldemort.store.Store |
---|
close, delete, delete, get, get, getAll, getAll, getCapability, getName, getVersions, put, put |
Method Detail |
---|
ClosableIterator<Pair<K,Versioned<V>>> entries()
ClosableIterator<K> keys()
ClosableIterator<Pair<K,Versioned<V>>> entries(int partition)
partition
- partition whose entries are to be fetched
ClosableIterator<K> keys(int partition)
partition
- partition whose keys are to be fetched
void truncate()
boolean isPartitionAware()
boolean isPartitionScanSupported()
boolean beginBatchModifications()
java.util.List<Versioned<V>> multiVersionPut(K key, java.util.List<Versioned<V>> values)
key
- Key to writevalues
- List of versioned values to be written atomically.
KeyLockHandle<V> getAndLock(K key)
putAndUnlock(Object, KeyLockHandle)
or
releaseLock(KeyLockHandle)
is called with the same
lock handle. The idea here is to facilitate custom atomic
Read-Modify-Write logic outside the storage engine
NOTE : An invocation of getAndLock should be followed by EXACTLY ONE call
to either putAndLock or releaseLock, for resources to be freed properly
key
-
void putAndUnlock(K key, KeyLockHandle<V> handle)
getAndLock(Object)
call, and update the key with
the set of values provided in the handle, also releasing the lock held on
the key.
key
- handle
- handle object with new list of versions to be storedvoid releaseLock(KeyLockHandle<V> handle)
AbstractStorageEngine.getAndLock(Object)
call. Helpful for
exception handling during a read-modify-cycle
handle
- boolean endBatchModifications()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |