Skip to main content

ColChunk

Enum ColChunk 

Source
pub enum ColChunk<U: ColumnarUpdate> {
    Resident(Rc<UpdatesTyped<U>>),
    Paged(Rc<PagedChunk<U>>),
}
Expand description

A sorted, consolidated columnar trie of ((key, val), time, diff): resident, or paged to backing storage.

Variants§

§

Resident(Rc<UpdatesTyped<U>>)

The trie in memory, shared via Rc.

§

Paged(Rc<PagedChunk<U>>)

Spilled out: resident bounds + a fetch handle (and a fill-once cache).

Implementations§

Source§

impl<U: ColumnarUpdate> ColChunk<U>

Source

pub fn from_trie(updates: UpdatesTyped<U>) -> Self

Wrap an already sorted, consolidated trie as a resident chunk. The chunker uses this to hand its melded UpdatesTyped blobs to the Chunk harness.

Source

pub fn updates_mut(&mut self) -> &mut UpdatesTyped<U>

Mutable access to the backing trie (materializing if paged, cloning if the Rc is shared), for builder closures that populate a chunk in place — e.g. reduce_abelian.

Trait Implementations§

Source§

impl<U: ColumnarUpdate> Accountable for ColChunk<U>

Source§

fn record_count(&self) -> i64

The number of records Read more
Source§

fn is_empty(&self) -> bool

Determine if this contains any updates, corresponding to update_count() == 0. It is a correctness error for this to be anything other than self.record_count() == 0.
Source§

impl<U: ColumnarUpdate> Chunk for ColChunk<U>
where U::Time: 'static,

Source§

fn merge( in1: &mut VecDeque<Self>, in2: &mut VecDeque<Self>, out: &mut VecDeque<Self>, )

Trie-native binary merge of the two deques’ front chunks through their shared horizon, via trie_merger::merge_pair: it merges one input fully and a prefix of the other (the survey/write_layer bulk range-copy), leaving the survivor’s suffix as a cursor we materialize with trie_merger::suffix_chunk and push back. The harness re-invokes.

One pair per call (not a resumable drain): merge_pair surveys each batch from index 0, so re-passing a large survivor would re-survey its whole body every call (quadratic). Re-materializing the suffix as a standalone chunk keeps each survey bounded by the shrinking remainder instead.

Source§

fn extract( input: &mut VecDeque<Self>, frontier: AntichainRef<'_, U::Time>, residual: &mut Antichain<U::Time>, keep: &mut VecDeque<Self>, ship: &mut VecDeque<Self>, )

Partition the front chunk by frontier (keep >=, ship <), folding kept times into residual, via trie_merger::extract. One chunk per call.

Source§

fn advance( input: &mut VecDeque<Self>, frontier: AntichainRef<'_, U::Time>, done: bool, out: &mut VecDeque<Self>, )

Advance times by frontier, consolidating each complete (key, val) group and withholding the last unless done.

Streams the input one chunk at a time, holding at most a single chunk plus the withheld trailing (key, val) group (the carry) — it never pulls the whole chain into core. Cross-chunk consolidation happens only where a (key, val) straddles a boundary: the (un-advanced) carry is melded onto the next chunk’s head, a sorted-chain meld that just stitches that one group. [advance_trie] then advances and consolidates the time runs within each chunk (keys / vals / diffs stay columnar refs, no global re-sort). Grading the emitted chunks is left to Chunk::settle.

Source§

fn settle(input: &mut VecDeque<Self>, done: bool, out: &mut VecDeque<Self>)

Maximal packing via the harness pack: coalesce by melding the next trie onto the carry (adjacent chunks of a sorted, consolidated chain, so meld’s “strictly greater first triple” precondition holds), split with trie_merger::split_at, and seal through [seal_chunk] (the spill point — pages a committed chunk when a spiller is installed).

Source§

const TARGET: usize = TARGET

The intended maximum chunk size.
Source§

type Time = <<ColumnarLayout<U> as Layout>::TimeContainer as BatchContainer>::Owned

The timestamp type of the chunk’s updates. Read more
Source§

fn len(&self) -> usize

The number of updates in the chunk.
Source§

impl<U: ColumnarUpdate> Clone for ColChunk<U>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<U: ColumnarUpdate> Consolidate for ColChunk<U>

Source§

fn len(&self) -> usize

The number of elements in the container.
Source§

fn clear(&mut self)

Clear the container.
Source§

fn consolidate_into(&mut self, target: &mut Self)

Sort and consolidate self into target.
Source§

impl<U: ColumnarUpdate> Default for ColChunk<U>

Source§

fn default() -> Self

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

impl<U: ColumnarUpdate> Navigable for ColChunk<U>
where U::Time: 'static,

Source§

type Cursor = ColChunkCursor<U>

The cursor type. Read more
Source§

fn cursor(&self) -> Self::Cursor

Acquire a cursor suitable for the instance.
Source§

impl<U: ColumnarUpdate> NavigableChunk for ColChunk<U>
where U::Time: 'static,

Source§

fn bounds( &self, ) -> ((<Self::Cursor as Cursor>::Key<'_>, <Self::Cursor as Cursor>::Val<'_>, <Self::Cursor as Cursor>::TimeGat<'_>), (<Self::Cursor as Cursor>::Key<'_>, <Self::Cursor as Cursor>::Val<'_>, <Self::Cursor as Cursor>::TimeGat<'_>))

The first and last (key, val, time) triples in the chunk.
Source§

impl<U: ColumnarUpdate> PushInto<((<U as ColumnarUpdate>::Key, <U as ColumnarUpdate>::Val), <U as ColumnarUpdate>::Time, <U as ColumnarUpdate>::Diff)> for ColChunk<U>

Source§

fn push_into(&mut self, item: ((U::Key, U::Val), U::Time, U::Diff))

Push item into self.
Source§

impl<U: ColumnarUpdate> SizableContainer for ColChunk<U>

Source§

fn at_capacity(&self) -> bool

Indicates that the container is “full” and should be shipped.
Source§

fn ensure_capacity(&mut self, _stash: &mut Option<Self>)

Restores self to its desired capacity, if it has one. Read more
Source§

impl<U: ColumnarUpdate> WithLayout for ColChunk<U>

Source§

type Layout = ColumnarLayout<U>

The layout.

Auto Trait Implementations§

§

impl<U> !RefUnwindSafe for ColChunk<U>

§

impl<U> !Send for ColChunk<U>

§

impl<U> !Sync for ColChunk<U>

§

impl<U> !UnwindSafe for ColChunk<U>

§

impl<U> Freeze for ColChunk<U>

§

impl<U> Unpin for ColChunk<U>

§

impl<U> UnsafeUnpin for ColChunk<U>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<C> Container for C
where C: Accountable + Default + 'static,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'a, S, T> Semigroup<&'a S> for T
where T: Semigroup<S>,

Source§

fn plus_equals(&mut self, rhs: &&'a S)

The method of std::ops::AddAssign, for types that do not implement AddAssign.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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.