|
||||||||||
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
public class BdbStorageEngine
A store that uses BDB for persistence
Field Summary | |
---|---|
protected BdbEnvironmentStats |
bdbEnvironmentStats
|
protected boolean |
checkpointerOffForBatchWrites
|
protected boolean |
minimizeScanImpact
|
Constructor Summary | |
---|---|
BdbStorageEngine(java.lang.String name,
com.sleepycat.je.Environment environment,
com.sleepycat.je.Database database,
BdbRuntimeConfig config)
|
Method Summary | |
---|---|
boolean |
beginBatchModifications()
A lot of storage engines support efficient methods for performing large number of writes (puts/deletes) against the data source. |
void |
close()
Close the store. |
boolean |
delete(ByteArray key,
Version version)
Delete all entries prior to the given version |
boolean |
endBatchModifications()
|
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. |
boolean |
equals(java.lang.Object o)
|
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. |
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 com.sleepycat.je.Database |
getBdbDatabase()
truncate() operation mandates that all opened Database be closed before attempting truncation. |
BdbEnvironmentStats |
getBdbEnvironmentStats()
|
java.lang.String |
getBdbStats()
|
java.lang.String |
getBdbStats(boolean fast)
|
protected org.apache.log4j.Logger |
getLogger()
|
com.sleepycat.je.DatabaseStats |
getStats(boolean setFast)
|
java.util.List<Version> |
getVersions(ByteArray key)
Get the versions associated with the given key. |
int |
hashCode()
|
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 |
nativeBackup(java.io.File toDir,
boolean verifyFiles,
boolean isIncremental,
AsyncOperationStatus status)
Perform a native backup |
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. |
void |
releaseLock(KeyLockHandle<byte[]> handle)
Release any lock held by a prior AbstractStorageEngine.getAndLock(Object) call. |
void |
truncate()
Truncate all entries in the store |
Methods inherited from class voldemort.store.AbstractStorageEngine |
---|
isPartitionAware, isPartitionScanSupported, 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 |
Field Detail |
---|
protected final BdbEnvironmentStats bdbEnvironmentStats
protected final boolean minimizeScanImpact
protected final boolean checkpointerOffForBatchWrites
Constructor Detail |
---|
public BdbStorageEngine(java.lang.String name, com.sleepycat.je.Environment environment, com.sleepycat.je.Database database, BdbRuntimeConfig config)
Method Detail |
---|
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 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
public void truncate()
StorageEngine
truncate
in interface StorageEngine<ByteArray,byte[],byte[]>
truncate
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
protected com.sleepycat.je.Database getBdbDatabase()
This method throws an exception while truncation is happening to any request attempting in parallel with store truncation.
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 java.util.List<Versioned<byte[]>> get(ByteArray key, byte[] transforms) throws PersistenceFailureException
Store
get
in interface Store<ByteArray,byte[],byte[]>
get
in class AbstractStore<ByteArray,byte[],byte[]>
key
- The key to check for
PersistenceFailureException
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 void put(ByteArray key, Versioned<byte[]> value, byte[] transforms) throws PersistenceFailureException
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.
PersistenceFailureException
public boolean delete(ByteArray key, Version version) throws PersistenceFailureException
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
PersistenceFailureException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void close() throws PersistenceFailureException
Store
close
in interface Store<ByteArray,byte[],byte[]>
close
in class AbstractStore<ByteArray,byte[],byte[]>
PersistenceFailureException
public com.sleepycat.je.DatabaseStats getStats(boolean setFast)
public java.lang.String getBdbStats()
public java.lang.String getBdbStats(boolean fast)
public BdbEnvironmentStats getBdbEnvironmentStats()
protected org.apache.log4j.Logger getLogger()
public void nativeBackup(java.io.File toDir, boolean verifyFiles, boolean isIncremental, AsyncOperationStatus status)
NativeBackupable
nativeBackup
in interface NativeBackupable
toDir
- The directory to backup toverifyFiles
- whether the integrity of the copied data needs to
be verifiedisIncremental
- is the backup incrementalstatus
- The async operation status to update/checkpublic boolean beginBatchModifications()
StorageEngine
beginBatchModifications
in interface StorageEngine<ByteArray,byte[],byte[]>
beginBatchModifications
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
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 AbstractStorageEngine<ByteArray,byte[],byte[]>
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 AbstractStorageEngine<ByteArray,byte[],byte[]>
handle
- handle object with new list of versions to be storedpublic void releaseLock(KeyLockHandle<byte[]> handle)
StorageEngine
AbstractStorageEngine.getAndLock(Object)
call. Helpful for
exception handling during a read-modify-cycle
releaseLock
in interface StorageEngine<ByteArray,byte[],byte[]>
releaseLock
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
public boolean endBatchModifications()
endBatchModifications
in interface StorageEngine<ByteArray,byte[],byte[]>
endBatchModifications
in class AbstractStorageEngine<ByteArray,byte[],byte[]>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |