Skip to main content

Merger

pub trait Merger: Default {
    type Chunk: Default;
    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 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: Default

The internal representation of chunks of data.

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 account(chunk: &Self::Chunk) -> (usize, usize, usize, usize)

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D, T, R> Merger for VecMerger<D, T, R>
where D: Ord + Clone + 'static, T: Ord + Clone + PartialOrder + 'static, R: Semigroup + 'static,