pub struct ColumnarMemtable { /* private fields */ }Expand description
Columnar memtable with skip-list-like concurrent access
Implementations§
Source§impl ColumnarMemtable
impl ColumnarMemtable
Sourcepub fn new(schema: TableSchema, size_limit: usize) -> Self
pub fn new(schema: TableSchema, size_limit: usize) -> Self
Create a new columnar memtable
Sourcepub fn insert(&self, row_id: RowId, values: &[Option<&[u8]>]) -> Result<()>
pub fn insert(&self, row_id: RowId, values: &[Option<&[u8]>]) -> Result<()>
Insert a row
values must have the same length as schema columns
Sourcepub fn get(&self, row_id: RowId) -> Option<Vec<Option<Vec<u8>>>>
pub fn get(&self, row_id: RowId) -> Option<Vec<Option<Vec<u8>>>>
Get a row by row ID (O(log N) lookup via BTreeMap) Returns all column values for the row
Sourcepub fn get_columns(
&self,
row_id: RowId,
col_indices: &[usize],
) -> Option<Vec<Option<Vec<u8>>>>
pub fn get_columns( &self, row_id: RowId, col_indices: &[usize], ) -> Option<Vec<Option<Vec<u8>>>>
Get specific columns for a row by row ID
Sourcepub fn scan_range(
&self,
start: RowId,
end: RowId,
) -> Vec<(RowId, Vec<Option<Vec<u8>>>)>
pub fn scan_range( &self, start: RowId, end: RowId, ) -> Vec<(RowId, Vec<Option<Vec<u8>>>)>
Scan a range of row IDs, returning all matching rows
Sourcepub fn memory_bytes(&self) -> usize
pub fn memory_bytes(&self) -> usize
Get memory usage
Sourcepub fn schema(&self) -> &TableSchema
pub fn schema(&self) -> &TableSchema
Get schema
Trait Implementations§
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> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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