public class SnapshotLevelDBKVStore extends LevelDBKVStore implements CloseableKVStore
KVStore view of a LevelDB 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 |
|---|
SnapshotLevelDBKVStore(org.iq80.leveldb.DB db,
boolean verifyChecksums)
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) |
finalize, get, getDB, getRange, toStringdecodeCounter, encodeCounter, getAtLeast, getAtMostclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitdecodeCounter, encodeCounter, get, getAtLeast, getAtMost, getRangepublic SnapshotLevelDBKVStore(org.iq80.leveldb.DB db,
boolean verifyChecksums)
db - LevelDB database to snapshotverifyChecksums - whether to verify checksums on readsNullPointerException - if db is nullpublic void close()
LevelDBKVStore
This closes any unclosed iterators returned from getRange().
This does not close the underlying DB or any associated WriteBatch.
close in interface Closeableclose in interface AutoCloseableclose in interface CloseableKVStoreclose in class LevelDBKVStorepublic void put(byte[] key,
byte[] value)
put in interface KVStoreput in class LevelDBKVStorepublic void remove(byte[] key)
remove in interface KVStoreremove in class LevelDBKVStorepublic 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 AbstractKVStoreCopyright © 2016. All rights reserved.