pub struct VersionedBatch {
pub data: Arc<RecordBatch>,
pub begin_ts: u64,
pub end_ts: Option<u64>,
pub sequence: u64,
}Expand description
A versioned RecordBatch with MVCC metadata.
Stores an immutable Arrow RecordBatch along with version information for Snapshot Isolation. Multiple versions can share the same RecordBatch via Arc, reducing memory overhead.
Fields§
§data: Arc<RecordBatch>The actual columnar data (immutable, shared via Arc)
begin_ts: u64Transaction timestamp when this batch became visible
end_ts: Option<u64>Transaction timestamp when this batch became obsolete (None = still active)
sequence: u64Batch sequence number for ordering within the same timestamp
Implementations§
Source§impl VersionedBatch
impl VersionedBatch
Sourcepub fn new(data: Arc<RecordBatch>, begin_ts: u64, sequence: u64) -> Self
pub fn new(data: Arc<RecordBatch>, begin_ts: u64, sequence: u64) -> Self
Create a new versioned batch.
Sourcepub fn mark_obsolete(&mut self, end_ts: u64)
pub fn mark_obsolete(&mut self, end_ts: u64)
Mark this batch as obsolete at the given timestamp.
Sourcepub fn is_visible(&self, read_ts: u64) -> bool
pub fn is_visible(&self, read_ts: u64) -> bool
Check if this batch is visible to a snapshot at the given read timestamp.
A batch is visible if:
- begin_ts <= read_ts
- end_ts is None OR end_ts > read_ts
Sourcepub fn is_obsolete(&self) -> bool
pub fn is_obsolete(&self) -> bool
Check if this batch is obsolete (has an end_ts).
Sourcepub fn num_columns(&self) -> usize
pub fn num_columns(&self) -> usize
Get the number of columns in this batch.
Trait Implementations§
Source§impl Clone for VersionedBatch
impl Clone for VersionedBatch
Source§fn clone(&self) -> VersionedBatch
fn clone(&self) -> VersionedBatch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VersionedBatch
impl !RefUnwindSafe for VersionedBatch
impl Send for VersionedBatch
impl Sync for VersionedBatch
impl Unpin for VersionedBatch
impl UnsafeUnpin for VersionedBatch
impl !UnwindSafe for VersionedBatch
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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