public class RocksDBAtomicKVStore extends ForwardingKVStore implements AtomicKVStore
AtomicKVStore view of a RocksDB database.
A database directory is the only required configuration property. Instances may be stopped and (re)started multiple times.
| Constructor and Description |
|---|
RocksDBAtomicKVStore()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected RocksDBKVStore |
delegate() |
protected void |
finalize()
Finalize this instance.
|
org.rocksdb.RocksDB |
getDB()
Get the underlying
RocksDB associated with this instance. |
File |
getDirectory()
Get the filesystem directory containing the database.
|
org.rocksdb.Options |
getOptions()
Get the
Options this instance will use when opening the database at startup. |
void |
mutate(Mutations mutations,
boolean sync) |
void |
setDirectory(File directory)
Configure the filesystem directory containing the database.
|
void |
setOptions(org.rocksdb.Options options)
Set the
Options this instance will use when opening the database at startup. |
SnapshotRocksDBKVStore |
snapshot() |
void |
start() |
void |
stop() |
String |
toString() |
adjustCounter, apply, decodeCounter, encodeCounter, get, getAtLeast, getAtMost, getRange, put, remove, removeRangeclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitadjustCounter, apply, decodeCounter, encodeCounter, get, getAtLeast, getAtMost, getRange, getRange, getRange, put, remove, removeRange, removeRangepublic File getDirectory()
public void setDirectory(File directory)
directory - database directoryIllegalStateException - if this instance is already start()edpublic org.rocksdb.RocksDB getDB()
RocksDB associated with this instance.RocksDBIllegalStateException - if this instance is not start()edpublic org.rocksdb.Options getOptions()
Options this instance will use when opening the database at startup.public void setOptions(org.rocksdb.Options options)
Options this instance will use when opening the database at startup.
Overwrites any previous options configuration(s).options - database optionsIllegalArgumentException - if options is nullIllegalStateException - if this instance is already start()ed@PostConstruct public void start()
start in interface AtomicKVStore@PreDestroy public void stop()
stop in interface AtomicKVStoreprotected RocksDBKVStore delegate()
delegate in class ForwardingKVStorepublic SnapshotRocksDBKVStore snapshot()
snapshot in interface AtomicKVStorepublic void mutate(Mutations mutations, boolean sync)
mutate in interface AtomicKVStoreprotected void finalize()
throws Throwable
stop() to close any unclosed iterators.Copyright © 2019. All rights reserved.