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

    // Required methods
    fn accept(
        &mut self,
        container: RefOrMut<'_, Self::Input>,
        stash: &mut Vec<Self::Chunk>
    ) -> Vec<Self::Chunk>;
    fn finish(&mut self, stash: &mut Vec<Self::Chunk>) -> Vec<Self::Chunk>;
    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 Input

The type of update containers received from inputs.

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 accept( &mut self, container: RefOrMut<'_, Self::Input>, stash: &mut Vec<Self::Chunk> ) -> Vec<Self::Chunk>

Accept a fresh container of input data.

source

fn finish(&mut self, stash: &mut Vec<Self::Chunk>) -> Vec<Self::Chunk>

Finish processing any stashed data.

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 Input = Vec<((K, V), T, R)>

§

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

§

type Output = ((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 Input = Vec<((K, V), T, R)>

§

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

§

type Output = ((K, V), T, R)