Skip to main content

TextColdDir

Struct TextColdDir 

Source
pub struct TextColdDir { /* private fields */ }
Expand description

The frozen text segments for one windowed full-text index on one shard, plus the bloom and tombstones that let a query skip or correct them without opening a file.

Implementations§

Source§

impl TextColdDir

Source

pub fn cold_stats(&self, tokens: &[Vec<u8>]) -> (u64, u64, Vec<(Vec<u8>, u32)>)

Pass-1 contribution: summed LIVE docs/length plus per-token live df across every cold segment (one fence descent per token per segment; the doc/length halves are in-memory numbers, no I/O at all).

Source

pub fn cold_page(&self, q: &ColdPageQuery<'_>) -> ColdPage

Pass-2 contribution: the clause-faithful cold page (see the module doc for what each clause does here).

Source§

impl TextColdDir

Source

pub fn new() -> Self

An empty directory: no segments, a fresh bloom, no tombstones.

Source

pub fn has_cold(&self) -> bool

Whether any segment has been sealed. false lets a query stay entirely in the live index.

Source

pub fn on_row_write(&mut self, row_key: &[u8])

The write path saw this row change: shadow its frozen entries and withdraw its statistics, exactly, in every segment that holds it (its forward record says which, and what to subtract).

Source

pub fn freeze_batch( &mut self, ts: &mut TextSegment, index_name: &[u8], keys: &[Vec<u8>], segs_dir: &Path, ) -> Result<bool, String>

Freeze keys out of the hot text segment into one sealed bucket segment. Failure leaves the hot segment SHRUNK but the batch unfrozen on disk — acceptable for derived spill (the entries are rebuildable from rows), reported to the caller.

Trait Implementations§

Source§

impl Default for TextColdDir

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.