public class SnapshotRocksDBKVStore extends RocksDBKVStore implements CloseableKVStore
KVStore view of a RocksDB Snapshot.
Instances must be close()'d when no longer needed to avoid leaking resources associated with iterators.
This class ensures that the configured Snapshot is closed when this instance is closed.
All mutation operations throw UnsupportedOperationException.
| Constructor and Description |
|---|
SnapshotRocksDBKVStore(org.rocksdb.RocksDB db)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjustCounter(byte[] key,
long amount) |
void |
close()
Close this instance.
|
void |
put(byte[] key,
byte[] value) |
void |
remove(byte[] key) |
void |
removeRange(byte[] minKey,
byte[] maxKey) |
decodeCounter, encodeCounter, finalize, get, getDB, getRange, toStringgetAtLeast, getAtMostclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitapply, decodeCounter, encodeCounter, get, getAtLeast, getAtMost, getRange, getRange, getRange, removeRangepublic SnapshotRocksDBKVStore(org.rocksdb.RocksDB db)
db - RocksDB database to snapshotNullPointerException - if db is nullpublic void close()
RocksDBKVStore
This closes any unclosed iterators returned from getRange().
This does not close the underlying RocksDB or any associated WriteBatch.
close in interface CloseableKVStoreclose in interface Closeableclose in interface AutoCloseableclose in class RocksDBKVStorepublic void put(byte[] key,
byte[] value)
put in interface KVStoreput in class RocksDBKVStorepublic void remove(byte[] key)
remove in interface KVStoreremove in class RocksDBKVStorepublic void removeRange(byte[] minKey,
byte[] maxKey)
removeRange in interface KVStoreremoveRange in class AbstractKVStorepublic void adjustCounter(byte[] key,
long amount)
adjustCounter in interface KVStoreadjustCounter in class RocksDBKVStoreCopyright © 2019. All rights reserved.