pub struct StreamingSstWriter<E: Entry> { /* private fields */ }Expand description
A streaming SST file writer that writes blocks to disk incrementally.
Instead of materializing all entries in memory and then writing all value blocks followed by all key blocks, this writer interleaves block writes as entries arrive. Medium values are written immediately, small values are accumulated into blocks, and key blocks are flushed as soon as their value references are all resolved.
The SST reader is block-index-addressed (not file-position-addressed), so interleaving block types is fully compatible.
Implementations§
Source§impl<E: Entry> StreamingSstWriter<E>
impl<E: Entry> StreamingSstWriter<E>
Sourcepub fn new(
file: &Path,
flags: MetaEntryFlags,
max_entry_count: u64,
) -> Result<Self>
pub fn new( file: &Path, flags: MetaEntryFlags, max_entry_count: u64, ) -> Result<Self>
Creates a new streaming SST writer.
max_entry_count is used to size the AMQF filter. It must be an upper bound on the number
of entries that will be added; the filter is not resizable. A slightly oversized value only
improves the false-positive rate.
Sourcepub fn is_full(&self, max_entries: usize, max_data_size: usize) -> bool
pub fn is_full(&self, max_entries: usize, max_data_size: usize) -> bool
Returns true if the SST file has reached capacity limits.
This is intended for compaction callers that need to split output across multiple SST files.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for StreamingSstWriter<E>
impl<E> RefUnwindSafe for StreamingSstWriter<E>where
E: RefUnwindSafe,
impl<E> Send for StreamingSstWriter<E>where
E: Send,
impl<E> Sync for StreamingSstWriter<E>where
E: Sync,
impl<E> Unpin for StreamingSstWriter<E>where
E: Unpin,
impl<E> UnsafeUnpin for StreamingSstWriter<E>
impl<E> UnwindSafe for StreamingSstWriter<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more