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<T, R, FR> Merger for FlatcontainerMerger<T, R, FR>
where for<'a> T: Ord + PartialOrder + PartialOrder<FR::Time<'a>> + Data, for<'a> R: Default + Semigroup + Semigroup<FR::Diff<'a>> + Data, for<'a> FR: MergerChunk + Clone + 'static + ReserveItems<<FR as Region>::ReadItem<'a>> + Push<<FR as Region>::ReadItem<'a>> + Push<((FR::Key<'a>, FR::Val<'a>), FR::Time<'a>, &'a R)> + Push<((FR::Key<'a>, FR::Val<'a>), FR::Time<'a>, FR::Diff<'a>)>, for<'a> FR::Time<'a>: PartialOrder<T> + Copy + IntoOwned<'a, Owned = T>, for<'a> FR::Diff<'a>: IntoOwned<'a, Owned = R>, for<'a> FR::ReadItem<'a>: Debug,

§

type Time = T

§

type Chunk = FlatStack<FR>

§

type Output = FlatStack<FR>