pub(super) struct FrnIndex {
ids: Vec<EntryId>,
covers: u32,
}Fields§
§ids: Vec<EntryId>EntryIds ordered by (masked record number, id). Appended entries
always carry the largest ids, so equal keys read old-before-new.
covers: u32Entries [0, covers) are represented; later ids are found by the
tail scan until Self::merge_appended runs (end of USN batch).
Implementations§
Source§impl FrnIndex
impl FrnIndex
Sourcepub(super) fn build(frn: &[u64], flag: &[u8]) -> Self
pub(super) fn build(frn: &[u64], flag: &[u8]) -> Self
Build from scratch over every live entry (initial scan finish, snapshot restore).
Sourcepub(super) fn lookup(
&self,
key: RecordNo,
frn: &[u64],
flag: &[u8],
) -> Option<EntryId>
pub(super) fn lookup( &self, key: RecordNo, frn: &[u64], flag: &[u8], ) -> Option<EntryId>
The live entry for key (a record number), if any.
Sourcepub(super) fn merge_appended(&mut self, frn: &[u64], flag: &[u8])
pub(super) fn merge_appended(&mut self, frn: &[u64], flag: &[u8])
Fold the appended entries into sorted order — live ones only;
anything tombstoned before its first merge can never be looked up
again. In place: each batch pair binary-searches its insertion point
and the segments between insertion points move once (copy_within)
— O(batch·log n) comparisons, no reallocation (ADR-0008).
Equal keys keep old-before-new order; liveness never depends on
that order anyway (at most one live pair per key).
Sourcepub(super) fn compact(&self, remap: &[EntryId], new_len: u32) -> Self
pub(super) fn compact(&self, remap: &[EntryId], new_len: u32) -> Self
Remapped copy for compaction: dead ids drop out, survivors renumber. Keys (masked record numbers) are copied unchanged by the caller and the remap preserves relative id order, so the (key, id) order — and with it lookup’s binary search — survives without a re-sort.
pub(super) const fn bytes(&self) -> u64
pub(super) fn shrink_to_fit(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FrnIndex
impl RefUnwindSafe for FrnIndex
impl Send for FrnIndex
impl Sync for FrnIndex
impl Unpin for FrnIndex
impl UnsafeUnpin for FrnIndex
impl UnwindSafe for FrnIndex
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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