public class LevelDBKVStore extends AbstractKVStore implements CloseableKVStore
| Constructor and Description |
|---|
LevelDBKVStore(org.iq80.leveldb.DB db)
Convenience constructor.
|
LevelDBKVStore(org.iq80.leveldb.DB db,
org.iq80.leveldb.ReadOptions readOptions,
org.iq80.leveldb.WriteBatch writeBatch)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this instance.
|
protected void |
finalize()
Finalize this instance.
|
byte[] |
get(byte[] key) |
org.iq80.leveldb.DB |
getDB()
Get the
DB underlying this instance. |
Iterator<KVPair> |
getRange(byte[] minKey,
byte[] maxKey,
boolean reverse) |
void |
put(byte[] key,
byte[] value) |
void |
remove(byte[] key) |
String |
toString() |
adjustCounter, decodeCounter, encodeCounter, getAtLeast, getAtMost, removeRangeclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitadjustCounter, decodeCounter, encodeCounter, getAtLeast, getAtMost, removeRangepublic LevelDBKVStore(org.iq80.leveldb.DB db)
db - databasepublic LevelDBKVStore(org.iq80.leveldb.DB db,
org.iq80.leveldb.ReadOptions readOptions,
org.iq80.leveldb.WriteBatch writeBatch)
db - databasereadOptions - read options, or null for the defaultwriteBatch - batch for write operations, or null for noneIllegalArgumentException - if db is nullpublic org.iq80.leveldb.DB getDB()
DB underlying this instance.public byte[] get(byte[] key)
get in interface KVStoreget in class AbstractKVStorepublic void put(byte[] key,
byte[] value)
put in interface KVStoreput in class AbstractKVStorepublic void remove(byte[] key)
remove in interface KVStoreremove in class AbstractKVStoreprotected void finalize()
throws Throwable
close() to close any unclosed iterators.public void close()
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 CloseableKVStoreCopyright © 2016. All rights reserved.