Package org.rocksdb
Class SstFileWriter
java.lang.Object
org.rocksdb.AbstractNativeReference
org.rocksdb.AbstractImmutableNativeReference
org.rocksdb.RocksObject
org.rocksdb.SstFileWriter
- All Implemented Interfaces:
AutoCloseable
SstFileWriter is used to create sst files that can be added to the
database later. All keys in files generated by SstFileWriter will have
sequence number = 0.
-
Field Summary
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_ -
Constructor Summary
ConstructorsConstructorDescriptionSstFileWriter(EnvOptions envOptions, Options options) SstFileWriter Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(byte[] key) Add a deletion key to currently opened file.voiddelete(DirectSlice key) Add a deletion key to currently opened file.voidAdd a deletion key to currently opened file.protected final voiddisposeInternal(long handle) longfileSize()Return the current file size.voidfinish()Finish the process and close the sst file.voidmerge(byte[] key, byte[] value) Add a Merge key with value to currently opened file.voidmerge(DirectSlice key, DirectSlice value) Add a Merge key with value to currently opened file.voidAdd a Merge key with value to currently opened file.voidPrepare SstFileWriter to write to a file.voidput(byte[] key, byte[] value) Add a Put key with value to currently opened file.voidput(ByteBuffer key, ByteBuffer value) Add a Put key with value to currently opened file.voidput(DirectSlice key, DirectSlice value) Add a Put key with value to currently opened file.voidAdd a Put key with value to currently opened file.Methods inherited from class org.rocksdb.RocksObject
disposeInternal, getNativeHandleMethods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Constructor Details
-
SstFileWriter
SstFileWriter Constructor.- Parameters:
envOptions-EnvOptionsinstance.options-Optionsinstance.
-
-
Method Details
-
open
Prepare SstFileWriter to write to a file.- Parameters:
filePath- the location of file- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
put
Add a Put key with value to currently opened file.- Parameters:
key- the specified key to be inserted.value- the value associated with the specified key.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
put
Add a Put key with value to currently opened file.- Parameters:
key- the specified key to be inserted.value- the value associated with the specified key.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
put
Add a Put key with value to currently opened file.- Parameters:
key- the specified key to be inserted.value- the value associated with the specified key.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
put
Add a Put key with value to currently opened file.- Parameters:
key- the specified key to be inserted.value- the value associated with the specified key.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
merge
Add a Merge key with value to currently opened file.- Parameters:
key- the specified key to be merged.value- the value to be merged with the current value for the specified key.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
merge
Add a Merge key with value to currently opened file.- Parameters:
key- the specified key to be merged.value- the value to be merged with the current value for the specified key.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
merge
Add a Merge key with value to currently opened file.- Parameters:
key- the specified key to be merged.value- the value to be merged with the current value for the specified key.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
delete
Add a deletion key to currently opened file.- Parameters:
key- the specified key to be deleted.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
delete
Add a deletion key to currently opened file.- Parameters:
key- the specified key to be deleted.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
delete
Add a deletion key to currently opened file.- Parameters:
key- the specified key to be deleted.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
finish
Finish the process and close the sst file.- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
fileSize
Return the current file size.- Returns:
- the current file size.
- Throws:
RocksDBException- thrown if error happens in underlying native library.
-
disposeInternal
protected final void disposeInternal(long handle) - Specified by:
disposeInternalin classRocksObject
-