pub struct SstFileWriter<'a> { /* private fields */ }Expand description
SstFileWriter is used to create sst files that can be added to database later All keys in files generated by SstFileWriter will have sequence number = 0.
Implementations§
Source§impl<'a> SstFileWriter<'a>
impl<'a> SstFileWriter<'a>
Sourcepub fn open<P: AsRef<Path>>(&'a self, path: P) -> Result<(), Error>
pub fn open<P: AsRef<Path>>(&'a self, path: P) -> Result<(), Error>
Prepare SstFileWriter to write into file located at “file_path”.
Sourcepub fn put<K, V>(&mut self, key: K, value: V) -> Result<(), Error>
pub fn put<K, V>(&mut self, key: K, value: V) -> Result<(), Error>
Adds a Put key with value to currently opened file REQUIRES: key is after any previously added key according to comparator.
Sourcepub fn put_with_ts<K, V, S>(
&mut self,
key: K,
ts: S,
value: V,
) -> Result<(), Error>
pub fn put_with_ts<K, V, S>( &mut self, key: K, ts: S, value: V, ) -> Result<(), Error>
Adds a Put key with value to currently opened file REQUIRES: key is after any previously added key according to comparator.
Sourcepub fn merge<K, V>(&mut self, key: K, value: V) -> Result<(), Error>
pub fn merge<K, V>(&mut self, key: K, value: V) -> Result<(), Error>
Adds a Merge key with value to currently opened file REQUIRES: key is after any previously added key according to comparator.
Sourcepub fn delete<K: AsRef<[u8]>>(&mut self, key: K) -> Result<(), Error>
pub fn delete<K: AsRef<[u8]>>(&mut self, key: K) -> Result<(), Error>
Adds a deletion key to currently opened file REQUIRES: key is after any previously added key according to comparator.
Sourcepub fn delete_range<K: AsRef<[u8]>>(
&mut self,
begin_key: K,
end_key: K,
) -> Result<(), Error>
pub fn delete_range<K: AsRef<[u8]>>( &mut self, begin_key: K, end_key: K, ) -> Result<(), Error>
Adds a range deletion tombstone to the currently opened file.
Unlike point entries, range tombstones may be added out of order.
REQUIRES: begin_key <= end_key according to the comparator.
REQUIRES: comparator is not timestamp-aware.