pub struct VectorVersionInfo { /* private fields */ }Expand description
Tracks insert/delete visibility for a single vector (1024 rows).
Uses a Mutex-protected map from transaction ID to a bitmap of
affected row indices within this vector.
Implementations§
Source§impl VectorVersionInfo
impl VectorVersionInfo
pub fn new() -> Self
Sourcepub fn insert(&self, txn_id: u64, row_in_vector: u32)
pub fn insert(&self, txn_id: u64, row_in_vector: u32)
Record that txn_id inserted a row at row_in_vector.
Sourcepub fn delete(&self, txn_id: u64, row_in_vector: u32)
pub fn delete(&self, txn_id: u64, row_in_vector: u32)
Record that txn_id deleted a row at row_in_vector.
Sourcepub fn reset(&self)
pub fn reset(&self)
Drop all recorded inserts and deletes for this vector.
Called when the owning node group’s in-memory buffer is cleared for reuse (spill/restore), so stale row-offset records do not collide with rows appended afterwards at the same offsets.
Sourcepub fn is_visible(
&self,
row_in_vector: u32,
snapshot_ts: u64,
commit_history: &HashMap<u64, u64>,
) -> bool
pub fn is_visible( &self, row_in_vector: u32, snapshot_ts: u64, commit_history: &HashMap<u64, u64>, ) -> bool
Check whether a specific row is visible at the given snapshot.
A row is visible if it was inserted by a committed transaction whose commit_ts ≤ snapshot_ts, and not deleted by any committed transaction whose commit_ts ≤ snapshot_ts.
commit_history is used to look up commit timestamps for
transaction IDs.
Sourcepub fn num_inserters(&self) -> usize
pub fn num_inserters(&self) -> usize
Number of unique transactions that inserted rows.
Sourcepub fn num_deleters(&self) -> usize
pub fn num_deleters(&self) -> usize
Number of unique transactions that deleted rows.
Trait Implementations§
Source§impl Clone for VectorVersionInfo
impl Clone for VectorVersionInfo
Source§impl Debug for VectorVersionInfo
impl Debug for VectorVersionInfo
Auto Trait Implementations§
impl !Freeze for VectorVersionInfo
impl RefUnwindSafe for VectorVersionInfo
impl Send for VectorVersionInfo
impl Sync for VectorVersionInfo
impl Unpin for VectorVersionInfo
impl UnsafeUnpin for VectorVersionInfo
impl UnwindSafe for VectorVersionInfo
Blanket Implementations§
impl<T> Allocation for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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