Skip to main content

Batcher

Trait Batcher 

Source
pub trait Batcher<Output>: SizeOf
where Output: Batch,
{ // Required methods fn new_batcher(vtables: &Output::Factories, time: Output::Time) -> Self; fn push_batch( &mut self, batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>, ); fn push_consolidated_batch( &mut self, batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>, ); fn tuples(&self) -> usize; fn seal(self) -> Output; }
Expand description

Functionality for collecting and batching updates.

Required Methods§

Source

fn new_batcher(vtables: &Output::Factories, time: Output::Time) -> Self

Allocates a new empty batcher. All tuples in the batcher (and its output batch) will have timestamp time.

Source

fn push_batch( &mut self, batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>, )

Adds an unordered batch of elements to the batcher.

Source

fn push_consolidated_batch( &mut self, batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>, )

Adds a consolidated batch of elements to the batcher.

A consolidated batch is sorted and contains no duplicates or zero weights.

Source

fn tuples(&self) -> usize

Returns the number of tuples in the batcher.

Source

fn seal(self) -> Output

Returns all updates not greater or equal to an element of upper.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<B> Batcher<B> for MergeBatcher<B>
where Self: SizeOf, B: Batch,