|Constructor and Description|
|Modifier and Type||Method and Description|
Adjust the counter at the given key by the given amount.
Close this instance.
Set the value associated with the given key.
Remove the key/value pair with the given key, if it exists.
Remove all key/value pairs whose keys are in a given range.
finalize, get, getDB, getRange, toString
decodeCounter, encodeCounter, getAtLeast, getAtMost
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public SnapshotLevelDBKVStore(org.iq80.leveldb.DB db, boolean verifyChecksums)
db- LevelDB database to snapshot
verifyChecksums- whether to verify checksums on reads
public void close()
This closes any unclosed iterators returned from
This does not close the underlying
DB or any associated
public void put(byte key, byte value)
public void remove(byte key)
public void removeRange(byte minKey, byte maxKey)
minKey must be less than or equal to
maxKey; if they equal (and not null)
then nothing happens; if they are both null then all entries are deleted.
If keys starting with
0xff are not supported by this instance, then:
0xff, then no change occurs
0xff, then this method behaves as if
public void adjustCounter(byte key, long amount)
Ideally this operation should behave in a lock-free manner, so that concurrent transactions can invoke it without conflict. However, when lock-free behavior occurs (if at all) depends on the implementation.
If there is no value associated with
key's value is not a valid counter encoding as
would be acceptable to
decodeCounter(), then how this operation affects
value is undefined.
Copyright © 2018. All rights reserved.