pub struct MutableRun { /* private fields */ }Expand description
The PMA-backed mutable run tier. Holds flushed-but-not-yet-spilled rows in
sorted (RowId, Epoch) order.
Implementations§
Source§impl MutableRun
impl MutableRun
pub fn new() -> Self
Sourcepub fn insert_many(&mut self, rows: Vec<Row>)
pub fn insert_many(&mut self, rows: Vec<Row>)
Fold drained memtable rows (already ascending by (RowId, Epoch)) into
the tier via one bulk merge + re-spread — far cheaper than per-element
inserts, which would cluster at the tail on sorted input.
pub fn is_empty(&self) -> bool
Sourcepub fn approx_bytes(&self) -> u64
pub fn approx_bytes(&self) -> u64
Approximate bytes held — the spill-threshold signal.
Sourcepub fn get_version(
&self,
row_id: RowId,
snapshot_epoch: Epoch,
) -> Option<(Epoch, Row)>
pub fn get_version( &self, row_id: RowId, snapshot_epoch: Epoch, ) -> Option<(Epoch, Row)>
Newest version of row_id with epoch <= snapshot (including
tombstones), mirroring Memtable::get_version. Returns None if no
version is visible. Seeks straight to row_id’s versions via the
PMA’s gappy binary search instead of scanning from the front.
Sourcepub fn visible_versions(&self, snapshot_epoch: Epoch) -> Vec<Row>
pub fn visible_versions(&self, snapshot_epoch: Epoch) -> Vec<Row>
Newest visible version per RowId at snapshot (including tombstones),
ascending by RowId — mirroring Memtable::visible_versions.
Sourcepub fn drain_sorted(&mut self) -> Vec<Row>
pub fn drain_sorted(&mut self) -> Vec<Row>
Drain every version in ascending (RowId, Epoch) order — the order
RunWriter::write requires when spilling to an immutable run.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MutableRun
impl RefUnwindSafe for MutableRun
impl Send for MutableRun
impl Sync for MutableRun
impl Unpin for MutableRun
impl UnsafeUnpin for MutableRun
impl UnwindSafe for MutableRun
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
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