|
||||||||||
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<K,V,T>
public class AbstractStorageEngine<K,V,T>
Constructor Summary | |
---|---|
AbstractStorageEngine(java.lang.String name)
|
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 partitionId)
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 StorageEngine.putAndUnlock(Object, KeyLockHandle) or
StorageEngine.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 partitionId)
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 StorageEngine.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 getAndLock(Object) call. |
protected java.util.List<Versioned<V>> |
resolveAndConstructVersionsToPersist(java.util.List<Versioned<V>> valuesInStorage,
java.util.List<Versioned<V>> multiPutValues)
Computes the final list of versions to be stored, on top of what is currently being stored. |
void |
truncate()
Truncate all entries in the store |
Methods inherited from class voldemort.store.AbstractStore |
---|
close, delete, delete, get, get, getAll, getAll, getCapability, getName, getVersions, put, 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, delete, get, get, getAll, getAll, getCapability, getName, getVersions, put, put |
Constructor Detail |
---|
public AbstractStorageEngine(java.lang.String name)
Method Detail |
---|
public ClosableIterator<Pair<K,Versioned<V>>> entries()
StorageEngine
entries
in interface StorageEngine<K,V,T>
public ClosableIterator<K> keys()
StorageEngine
keys
in interface StorageEngine<K,V,T>
public ClosableIterator<Pair<K,Versioned<V>>> entries(int partitionId)
StorageEngine
entries
in interface StorageEngine<K,V,T>
partitionId
- partition whose entries are to be fetched
public ClosableIterator<K> keys(int partitionId)
StorageEngine
keys
in interface StorageEngine<K,V,T>
partitionId
- partition whose keys are to be fetched
public void truncate()
StorageEngine
truncate
in interface StorageEngine<K,V,T>
public boolean isPartitionAware()
StorageEngine
isPartitionAware
in interface StorageEngine<K,V,T>
public boolean isPartitionScanSupported()
StorageEngine
isPartitionScanSupported
in interface StorageEngine<K,V,T>
public boolean beginBatchModifications()
StorageEngine
beginBatchModifications
in interface StorageEngine<K,V,T>
public java.util.List<Versioned<V>> multiVersionPut(K key, java.util.List<Versioned<V>> values)
StorageEngine
multiVersionPut
in interface StorageEngine<K,V,T>
key
- Key to writevalues
- List of versioned values to be written atomically.
public boolean endBatchModifications()
endBatchModifications
in interface StorageEngine<K,V,T>
protected java.util.List<Versioned<V>> resolveAndConstructVersionsToPersist(java.util.List<Versioned<V>> valuesInStorage, java.util.List<Versioned<V>> multiPutValues)
valuesInStorage
- list of versions currently in storagemultiPutValues
- list of new versions being written to storage
public KeyLockHandle<V> getAndLock(K key)
StorageEngine
StorageEngine.putAndUnlock(Object, KeyLockHandle)
or
StorageEngine.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
getAndLock
in interface StorageEngine<K,V,T>
public void putAndUnlock(K key, KeyLockHandle<V> handle)
StorageEngine
StorageEngine.getAndLock(Object)
call, and update the key with
the set of values provided in the handle, also releasing the lock held on
the key.
putAndUnlock
in interface StorageEngine<K,V,T>
handle
- handle object with new list of versions to be storedpublic void releaseLock(KeyLockHandle<V> handle)
StorageEngine
getAndLock(Object)
call. Helpful for
exception handling during a read-modify-cycle
releaseLock
in interface StorageEngine<K,V,T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |