pub trait Merger: Default {
    type Chunk: Container;
    type Output;
    type Time;

    // Required methods
    fn merge(
        &mut self,
        list1: Vec<Self::Chunk>,
        list2: Vec<Self::Chunk>,
        output: &mut Vec<Self::Chunk>,
        stash: &mut Vec<Self::Chunk>,
    );
    fn extract(
        &mut self,
        merged: Vec<Self::Chunk>,
        upper: AntichainRef<'_, Self::Time>,
        frontier: &mut Antichain<Self::Time>,
        readied: &mut Vec<Self::Chunk>,
        kept: &mut Vec<Self::Chunk>,
        stash: &mut Vec<Self::Chunk>,
    );
    fn seal<B: Builder<Input = Self::Output, Time = Self::Time>>(
        chain: &mut Vec<Self::Chunk>,
        lower: AntichainRef<'_, Self::Time>,
        upper: AntichainRef<'_, Self::Time>,
        since: AntichainRef<'_, Self::Time>,
    ) -> B::Output;
    fn account(chunk: &Self::Chunk) -> (usize, usize, usize, usize);
}
Expand description

A trait to describe interesting moments in a merge batcher.

Required Associated Types§

source

type Chunk: Container

The internal representation of chunks of data.

source

type Output

The output type TODO: This should be replaced by Chunk or another container once the builder understands building from a complete chain.

source

type Time

The type of time in frontiers to extract updates.

Required Methods§

source

fn merge( &mut self, list1: Vec<Self::Chunk>, list2: Vec<Self::Chunk>, output: &mut Vec<Self::Chunk>, stash: &mut Vec<Self::Chunk>, )

Merge chains into an output chain.

source

fn extract( &mut self, merged: Vec<Self::Chunk>, upper: AntichainRef<'_, Self::Time>, frontier: &mut Antichain<Self::Time>, readied: &mut Vec<Self::Chunk>, kept: &mut Vec<Self::Chunk>, stash: &mut Vec<Self::Chunk>, )

Extract ready updates based on the upper frontier.

source

fn seal<B: Builder<Input = Self::Output, Time = Self::Time>>( chain: &mut Vec<Self::Chunk>, lower: AntichainRef<'_, Self::Time>, upper: AntichainRef<'_, Self::Time>, since: AntichainRef<'_, Self::Time>, ) -> B::Output

Build from a chain TODO: We can move this entirely to MergeBatcher once builders can accepts chains.

source

fn account(chunk: &Self::Chunk) -> (usize, usize, usize, usize)

Account size and allocation changes. Returns a tuple of (records, size, capacity, allocations).

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<K, V, T, R> Merger for ColumnationMerger<((K, V), T, R)>
where K: Columnation + Ord + Data, V: Columnation + Ord + Data, T: Columnation + Ord + PartialOrder + Data, R: Columnation + Semigroup + 'static,

§

type Time = T

§

type Chunk = TimelyStack<((K, V), T, R)>

§

type Output = TimelyStack<((K, V), T, R)>

source§

impl<K, V, T, R> Merger for VecMerger<((K, V), T, R)>
where K: Data, V: Data, T: Ord + PartialOrder + Clone + 'static, R: Semigroup + 'static,

§

type Time = T

§

type Chunk = Vec<((K, V), T, R)>

§

type Output = Vec<((K, V), T, R)>

source§

impl<MC> Merger for FlatcontainerMerger<MC>
where for<'a> MC: MergerChunk + Clone + 'static + ReserveItems<<MC as Region>::ReadItem<'a>> + Push<<MC as Region>::ReadItem<'a>> + Push<((MC::Key<'a>, MC::Val<'a>), MC::Time<'a>, &'a MC::DiffOwned)> + Push<((MC::Key<'a>, MC::Val<'a>), MC::Time<'a>, MC::Diff<'a>)>, for<'a> MC::Time<'a>: PartialOrder<MC::TimeOwned> + Copy + IntoOwned<'a, Owned = MC::TimeOwned>, for<'a> MC::Diff<'a>: IntoOwned<'a, Owned = MC::DiffOwned>, for<'a> MC::TimeOwned: Ord + PartialOrder + PartialOrder<MC::Time<'a>> + Data, for<'a> MC::DiffOwned: Default + Semigroup + Semigroup<MC::Diff<'a>> + Data,

§

type Time = <MC as MergerChunk>::TimeOwned

§

type Chunk = FlatStack<MC>

§

type Output = FlatStack<MC>