public class JniDB
extends java.lang.Object
implements org.iq80.leveldb.DB
| Modifier and Type | Field and Description |
|---|---|
private NativeCache |
cache |
private NativeComparator |
comparator |
private NativeDB |
db |
private NativeLogger |
logger |
| Constructor and Description |
|---|
JniDB(NativeDB db,
NativeCache cache,
NativeComparator comparator,
NativeLogger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
compactRange(byte[] begin,
byte[] end) |
private NativeReadOptions |
convert(org.iq80.leveldb.ReadOptions options) |
private NativeWriteOptions |
convert(org.iq80.leveldb.WriteOptions options) |
org.iq80.leveldb.WriteBatch |
createWriteBatch() |
void |
delete(byte[] key) |
org.iq80.leveldb.Snapshot |
delete(byte[] key,
org.iq80.leveldb.WriteOptions options) |
byte[] |
get(byte[] key) |
byte[] |
get(byte[] key,
org.iq80.leveldb.ReadOptions options) |
long[] |
getApproximateSizes(org.iq80.leveldb.Range... ranges) |
java.lang.String |
getProperty(java.lang.String name) |
org.iq80.leveldb.Snapshot |
getSnapshot() |
org.iq80.leveldb.DBIterator |
iterator() |
org.iq80.leveldb.DBIterator |
iterator(org.iq80.leveldb.ReadOptions options) |
void |
put(byte[] key,
byte[] value) |
org.iq80.leveldb.Snapshot |
put(byte[] key,
byte[] value,
org.iq80.leveldb.WriteOptions options) |
void |
resumeCompactions() |
void |
suspendCompactions() |
void |
write(org.iq80.leveldb.WriteBatch updates) |
org.iq80.leveldb.Snapshot |
write(org.iq80.leveldb.WriteBatch updates,
org.iq80.leveldb.WriteOptions options) |
private NativeDB db
private NativeCache cache
private NativeComparator comparator
private NativeLogger logger
public JniDB(NativeDB db, NativeCache cache, NativeComparator comparator, NativeLogger logger)
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic byte[] get(byte[] key)
throws org.iq80.leveldb.DBException
get in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic byte[] get(byte[] key,
org.iq80.leveldb.ReadOptions options)
throws org.iq80.leveldb.DBException
get in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic org.iq80.leveldb.DBIterator iterator()
iterator in interface java.lang.Iterable<java.util.Map.Entry<byte[],byte[]>>iterator in interface org.iq80.leveldb.DBpublic org.iq80.leveldb.DBIterator iterator(org.iq80.leveldb.ReadOptions options)
iterator in interface org.iq80.leveldb.DBpublic void put(byte[] key,
byte[] value)
throws org.iq80.leveldb.DBException
put in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic void delete(byte[] key)
throws org.iq80.leveldb.DBException
delete in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic void write(org.iq80.leveldb.WriteBatch updates)
throws org.iq80.leveldb.DBException
write in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic org.iq80.leveldb.WriteBatch createWriteBatch()
createWriteBatch in interface org.iq80.leveldb.DBpublic org.iq80.leveldb.Snapshot put(byte[] key,
byte[] value,
org.iq80.leveldb.WriteOptions options)
throws org.iq80.leveldb.DBException
put in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic org.iq80.leveldb.Snapshot delete(byte[] key,
org.iq80.leveldb.WriteOptions options)
throws org.iq80.leveldb.DBException
delete in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic org.iq80.leveldb.Snapshot write(org.iq80.leveldb.WriteBatch updates,
org.iq80.leveldb.WriteOptions options)
throws org.iq80.leveldb.DBException
write in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic org.iq80.leveldb.Snapshot getSnapshot()
getSnapshot in interface org.iq80.leveldb.DBpublic long[] getApproximateSizes(org.iq80.leveldb.Range... ranges)
getApproximateSizes in interface org.iq80.leveldb.DBpublic java.lang.String getProperty(java.lang.String name)
getProperty in interface org.iq80.leveldb.DBprivate NativeReadOptions convert(org.iq80.leveldb.ReadOptions options)
private NativeWriteOptions convert(org.iq80.leveldb.WriteOptions options)
public void compactRange(byte[] begin,
byte[] end)
throws org.iq80.leveldb.DBException
compactRange in interface org.iq80.leveldb.DBorg.iq80.leveldb.DBExceptionpublic void suspendCompactions()
throws java.lang.InterruptedException
suspendCompactions in interface org.iq80.leveldb.DBjava.lang.InterruptedExceptionpublic void resumeCompactions()
resumeCompactions in interface org.iq80.leveldb.DB