pub struct ColumnarMemtable { /* private fields */ }Expand description
In-memory columnar buffer that accumulates INSERTs.
Each column is stored as a typed vector. The memtable flushes to a compressed segment when the row count reaches the threshold.
Implementations§
Source§impl ColumnarMemtable
impl ColumnarMemtable
Sourcepub fn new(schema: &ColumnarSchema) -> Self
pub fn new(schema: &ColumnarSchema) -> Self
Create a new empty memtable for the given schema.
Sourcepub fn with_threshold(schema: &ColumnarSchema, flush_threshold: usize) -> Self
pub fn with_threshold(schema: &ColumnarSchema, flush_threshold: usize) -> Self
Create with a custom flush threshold.
Sourcepub fn append_row(&mut self, values: &[Value]) -> Result<(), ColumnarError>
pub fn append_row(&mut self, values: &[Value]) -> Result<(), ColumnarError>
Append a row of values. Validates types and nullability.
Sourcepub fn should_flush(&self) -> bool
pub fn should_flush(&self) -> bool
Whether the memtable has reached its flush threshold.
Sourcepub fn schema(&self) -> &ColumnarSchema
pub fn schema(&self) -> &ColumnarSchema
Access the schema.
Sourcepub fn columns(&self) -> &[ColumnData]
pub fn columns(&self) -> &[ColumnData]
Access the raw column data (for the segment writer).
Sourcepub fn drain(&mut self) -> (ColumnarSchema, Vec<ColumnData>, usize)
pub fn drain(&mut self) -> (ColumnarSchema, Vec<ColumnData>, usize)
Drain the memtable: return all column data and reset to empty.
Auto Trait Implementations§
impl Freeze for ColumnarMemtable
impl RefUnwindSafe for ColumnarMemtable
impl Send for ColumnarMemtable
impl Sync for ColumnarMemtable
impl Unpin for ColumnarMemtable
impl UnsafeUnpin for ColumnarMemtable
impl UnwindSafe for ColumnarMemtable
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.