Package org.iq80.leveldb
Interface DB
- All Superinterfaces:
AutoCloseable,Closeable,Iterable<Map.Entry<byte[],byte[]>>
- All Known Implementing Classes:
DbImpl
-
Method Summary
Modifier and TypeMethodDescriptionvoidcompactRange(byte[] begin, byte[] end) Force a compaction of the specified key range.voiddelete(byte[] key) delete(byte[] key, WriteOptions options) byte[]get(byte[] key) byte[]get(byte[] key, ReadOptions options) long[]getApproximateSizes(Range... ranges) getProperty(String name) iterator()iterator(ReadOptions options) voidput(byte[] key, byte[] value) put(byte[] key, byte[] value, WriteOptions options) voidResumes the background compaction threads.voidSuspends any background compaction threads.voidwrite(WriteBatch updates) write(WriteBatch updates, WriteOptions options) Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
get
- Throws:
DBException
-
get
- Throws:
DBException
-
iterator
DBIterator iterator() -
iterator
-
put
- Throws:
DBException
-
delete
- Throws:
DBException
-
write
- Throws:
DBException
-
createWriteBatch
WriteBatch createWriteBatch() -
put
- Returns:
- null if options.isSnapshot()==false otherwise returns a snapshot of the DB after this operation.
- Throws:
DBException
-
delete
- Returns:
- null if options.isSnapshot()==false otherwise returns a snapshot of the DB after this operation.
- Throws:
DBException
-
write
- Returns:
- null if options.isSnapshot()==false otherwise returns a snapshot of the DB after this operation.
- Throws:
DBException
-
getSnapshot
Snapshot getSnapshot() -
getApproximateSizes
-
getProperty
-
suspendCompactions
Suspends any background compaction threads. This methods returns once the background compactions are suspended.- Throws:
InterruptedException
-
resumeCompactions
void resumeCompactions()Resumes the background compaction threads. -
compactRange
Force a compaction of the specified key range.- Parameters:
begin- if null then compaction start from the first keyend- if null then compaction ends at the last key- Throws:
DBException
-