pub struct ColumnarDelta { /* private fields */ }Expand description
Columnar Delta Store with MVCC support.
Stores versioned RecordBatches for each table, enabling:
- Snapshot Isolation via VersionedBatch
- Efficient columnar scans via Arrow
- Memory sharing via
Arc<RecordBatch>
Implementations§
Source§impl ColumnarDelta
impl ColumnarDelta
Sourcepub fn new(flush_threshold: usize) -> Self
pub fn new(flush_threshold: usize) -> Self
Create a new ColumnarDelta with the given flush threshold.
Sourcepub fn insert_versioned_batch(
&self,
table: &str,
batch: RecordBatch,
begin_ts: u64,
) -> DbxResult<()>
pub fn insert_versioned_batch( &self, table: &str, batch: RecordBatch, begin_ts: u64, ) -> DbxResult<()>
Insert a versioned batch for a table.
The batch will be assigned a sequence number and begin_ts.
Sourcepub fn get_visible_batches(
&self,
table: &str,
read_ts: u64,
) -> Vec<Arc<RecordBatch>>
pub fn get_visible_batches( &self, table: &str, read_ts: u64, ) -> Vec<Arc<RecordBatch>>
Get all batches visible to a snapshot at the given read_ts.
Sourcepub fn should_flush(&self) -> bool
pub fn should_flush(&self) -> bool
Check if flush is needed based on row count threshold.
Sourcepub fn drain_table(&self, table: &str) -> Vec<VersionedBatch>
pub fn drain_table(&self, table: &str) -> Vec<VersionedBatch>
Drain all batches from a table (for flushing to WOS/Parquet).
Returns all batches and clears the table.
Sourcepub fn table_names(&self) -> Vec<String>
pub fn table_names(&self) -> Vec<String>
Get all table names.
Trait Implementations§
Source§impl StorageBackend for ColumnarDelta
impl StorageBackend for ColumnarDelta
Source§fn insert(&self, table: &str, key: &[u8], value: &[u8]) -> DbxResult<()>
fn insert(&self, table: &str, key: &[u8], value: &[u8]) -> DbxResult<()>
Insert a key-value pair.
Source§fn insert_batch(
&self,
table: &str,
rows: Vec<(Vec<u8>, Vec<u8>)>,
) -> DbxResult<()>
fn insert_batch( &self, table: &str, rows: Vec<(Vec<u8>, Vec<u8>)>, ) -> DbxResult<()>
Insert multiple key-value pairs in a batch (optimized). Read more
Source§fn scan<R: RangeBounds<Vec<u8>> + Clone>(
&self,
table: &str,
range: R,
) -> DbxResult<Vec<(Vec<u8>, Vec<u8>)>>
fn scan<R: RangeBounds<Vec<u8>> + Clone>( &self, table: &str, range: R, ) -> DbxResult<Vec<(Vec<u8>, Vec<u8>)>>
Scan a range of keys.
Source§fn scan_one<R: RangeBounds<Vec<u8>> + Clone>(
&self,
table: &str,
range: R,
) -> DbxResult<Option<(Vec<u8>, Vec<u8>)>>
fn scan_one<R: RangeBounds<Vec<u8>> + Clone>( &self, table: &str, range: R, ) -> DbxResult<Option<(Vec<u8>, Vec<u8>)>>
Scan a single key-value pair in a range (optimized).
Auto Trait Implementations§
impl !Freeze for ColumnarDelta
impl !RefUnwindSafe for ColumnarDelta
impl Send for ColumnarDelta
impl Sync for ColumnarDelta
impl Unpin for ColumnarDelta
impl UnsafeUnpin for ColumnarDelta
impl !UnwindSafe for ColumnarDelta
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
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