|
||||||||||
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.bdb.BdbStorageEngine
voldemort.store.bdb.PartitionPrefixedBdbStorageEngine
public class PartitionPrefixedBdbStorageEngine
Extends BDB Storage Engine with capabilities to perform partition range scans, to speed up scan jobs, that filter on partition id
Field Summary |
---|
Fields inherited from class voldemort.store.bdb.BdbStorageEngine |
---|
bdbEnvironmentStats, checkpointerOffForBatchWrites, minimizeScanImpact |
Constructor Summary | |
---|---|
PartitionPrefixedBdbStorageEngine(java.lang.String name,
com.sleepycat.je.Environment environment,
com.sleepycat.je.Database database,
BdbRuntimeConfig config,
RoutingStrategy strategy)
|
Method Summary | |
---|---|
boolean |
delete(ByteArray key,
Version version)
Delete all entries prior to the given version |
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 |
KeyLockHandle<byte[]> |
getAndLock(ByteArray 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. |
protected org.apache.log4j.Logger |
getLogger()
|
boolean |
isPartitionScanSupported()
Does the storage engine support efficient scanning of a single partition? |
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 |
putAndUnlock(ByteArray key,
KeyLockHandle<byte[]> 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. |
Methods inherited from class voldemort.store.bdb.BdbStorageEngine |
---|
beginBatchModifications, close, endBatchModifications, entries, equals, getAll, getBdbDatabase, getBdbEnvironmentStats, getBdbStats, getBdbStats, getStats, getVersions, hashCode, keys, nativeBackup, releaseLock, truncate |
Methods inherited from class voldemort.store.AbstractStorageEngine |
---|
isPartitionAware, multiVersionPut, resolveAndConstructVersionsToPersist |
Methods inherited from class voldemort.store.AbstractStore |
---|
delete, get, getAll, getCapability, getName, put |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface voldemort.store.Store |
---|
delete, get, getAll, getCapability, getName, put |
Constructor Detail |
---|
public PartitionPrefixedBdbStorageEngine(java.lang.String name, com.sleepycat.je.Environment environment, com.sleepycat.je.Database database, BdbRuntimeConfig config, RoutingStrategy strategy)
Method Detail |
---|
public ClosableIterator<Pair<ByteArray,Versioned<byte[]>>> entries(int partition)
StorageEngine
entries
in interface StorageEngine<ByteArray,byte[],byte[]>
entries
in class BdbStorageEngine
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 BdbStorageEngine
partition
- partition whose keys are to be fetched
public java.util.List<Versioned<byte[]>> get(ByteArray key, byte[] transforms) throws PersistenceFailureException
Store
get
in interface Store<ByteArray,byte[],byte[]>
get
in class BdbStorageEngine
key
- The key to check for
PersistenceFailureException
public void put(ByteArray key, Versioned<byte[]> value, byte[] transforms) throws PersistenceFailureException
Store
put
in interface Store<ByteArray,byte[],byte[]>
put
in class BdbStorageEngine
key
- The key to usevalue
- The value to store and its version.
PersistenceFailureException
public boolean delete(ByteArray key, Version version) throws PersistenceFailureException
Store
delete
in interface Store<ByteArray,byte[],byte[]>
delete
in class BdbStorageEngine
key
- The key to deleteversion
- The current value of the key
PersistenceFailureException
public KeyLockHandle<byte[]> getAndLock(ByteArray 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<ByteArray,byte[],byte[]>
getAndLock
in class BdbStorageEngine
public void putAndUnlock(ByteArray key, KeyLockHandle<byte[]> 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<ByteArray,byte[],byte[]>
putAndUnlock
in class BdbStorageEngine
handle
- handle object with new list of versions to be storedprotected org.apache.log4j.Logger getLogger()
getLogger
in class BdbStorageEngine
public boolean isPartitionScanSupported()
StorageEngine
isPartitionScanSupported
in interface StorageEngine<ByteArray,byte[],byte[]>
isPartitionScanSupported
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |