Trait mz_timely_util::operator::CollectionExt

source ·
pub trait CollectionExt<G, D1, R>
where G: Scope, R: Semigroup,
{ // Required methods fn empty(scope: &G) -> Collection<G, D1, R>; fn flat_map_fallible<D2, E, I, L>( &self, name: &str, logic: L ) -> (Collection<G, D2, R>, Collection<G, E, R>) where D2: Data, E: Data, I: IntoIterator<Item = Result<D2, E>>, L: FnMut(D1) -> I + 'static; fn explode_one<D2, R2, L>( &self, logic: L ) -> Collection<G, D2, <R2 as Multiply<R>>::Output> where D2: Data, R2: Semigroup + Multiply<R>, <R2 as Multiply<R>>::Output: Data + Semigroup, L: FnMut(D1) -> (D2, R2) + 'static, G::Timestamp: Lattice; fn ensure_monotonic<E, IE>( &self, into_err: IE ) -> (Collection<G, D1, R>, Collection<G, E, R>) where E: Data, IE: Fn(D1, R) -> (E, R) + 'static, R: Signed; fn with_token(&self, token: Weak<()>) -> Collection<G, D1, R>; fn consolidate_named_if<Ba>( self, must_consolidate: bool, name: &str ) -> Self where D1: ExchangeData + Hash, R: Semigroup + ExchangeData, G::Timestamp: Lattice, Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = ((D1, ()), G::Timestamp, R), Time = G::Timestamp> + 'static; fn consolidate_named<Ba>(self, name: &str) -> Self where D1: ExchangeData + Hash, R: Semigroup + ExchangeData, G::Timestamp: Lattice, Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = ((D1, ()), G::Timestamp, R), Time = G::Timestamp> + 'static; // Provided method fn map_fallible<D2, E, L>( &self, name: &str, logic: L ) -> (Collection<G, D2, R>, Collection<G, E, R>) where D2: Data, E: Data, L: FnMut(D1) -> Result<D2, E> + 'static { ... } }
Expand description

Extension methods for differential Collections.

Required Methods§

source

fn empty(scope: &G) -> Collection<G, D1, R>

Creates a new empty collection in scope.

source

fn flat_map_fallible<D2, E, I, L>( &self, name: &str, logic: L ) -> (Collection<G, D2, R>, Collection<G, E, R>)
where D2: Data, E: Data, I: IntoIterator<Item = Result<D2, E>>, L: FnMut(D1) -> I + 'static,

Like Collection::flat_map, but logic is allowed to fail. The first returned collection will contain the successful applications of logic, while the second returned collection will contain the failed applications.

source

fn explode_one<D2, R2, L>( &self, logic: L ) -> Collection<G, D2, <R2 as Multiply<R>>::Output>
where D2: Data, R2: Semigroup + Multiply<R>, <R2 as Multiply<R>>::Output: Data + Semigroup, L: FnMut(D1) -> (D2, R2) + 'static, G::Timestamp: Lattice,

Replaces each record with another, with a new difference type.

This method is most commonly used to take records containing aggregatable data (e.g. numbers to be summed) and move the data into the difference component. This will allow differential dataflow to update in-place.

source

fn ensure_monotonic<E, IE>( &self, into_err: IE ) -> (Collection<G, D1, R>, Collection<G, E, R>)
where E: Data, IE: Fn(D1, R) -> (E, R) + 'static, R: Signed,

Partitions the input into a monotonic collection and non-monotone exceptions, with respect to differences.

The exceptions are transformed by into_err.

source

fn with_token(&self, token: Weak<()>) -> Collection<G, D1, R>

Wraps the collection with an operator that passes through all received inputs as long as the provided token can be upgraded. Once the token cannot be upgraded anymore, all data flowing into the operator is dropped.

source

fn consolidate_named_if<Ba>(self, must_consolidate: bool, name: &str) -> Self
where D1: ExchangeData + Hash, R: Semigroup + ExchangeData, G::Timestamp: Lattice, Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = ((D1, ()), G::Timestamp, R), Time = G::Timestamp> + 'static,

Consolidates the collection if must_consolidate is true and leaves it untouched otherwise.

source

fn consolidate_named<Ba>(self, name: &str) -> Self
where D1: ExchangeData + Hash, R: Semigroup + ExchangeData, G::Timestamp: Lattice, Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = ((D1, ()), G::Timestamp, R), Time = G::Timestamp> + 'static,

Consolidates the collection.

Provided Methods§

source

fn map_fallible<D2, E, L>( &self, name: &str, logic: L ) -> (Collection<G, D2, R>, Collection<G, E, R>)
where D2: Data, E: Data, L: FnMut(D1) -> Result<D2, E> + 'static,

Like Collection::map, but logic is allowed to fail. The first returned collection will contain successful applications of logic, while the second returned collection will contain the failed applications.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<G, D1, R> CollectionExt<G, D1, R> for Collection<G, D1, R>
where G: Scope, G::Timestamp: Data, D1: Data, R: Semigroup,

source§

fn empty(scope: &G) -> Collection<G, D1, R>

source§

fn flat_map_fallible<D2, E, I, L>( &self, name: &str, logic: L ) -> (Collection<G, D2, R>, Collection<G, E, R>)
where D2: Data, E: Data, I: IntoIterator<Item = Result<D2, E>>, L: FnMut(D1) -> I + 'static,

source§

fn explode_one<D2, R2, L>( &self, logic: L ) -> Collection<G, D2, <R2 as Multiply<R>>::Output>
where D2: Data, R2: Semigroup + Multiply<R>, <R2 as Multiply<R>>::Output: Data + Semigroup, L: FnMut(D1) -> (D2, R2) + 'static, G::Timestamp: Lattice,

source§

fn ensure_monotonic<E, IE>( &self, into_err: IE ) -> (Collection<G, D1, R>, Collection<G, E, R>)
where E: Data, IE: Fn(D1, R) -> (E, R) + 'static, R: Signed,

source§

fn with_token(&self, token: Weak<()>) -> Collection<G, D1, R>

source§

fn consolidate_named_if<Ba>(self, must_consolidate: bool, name: &str) -> Self
where D1: ExchangeData + Hash, R: Semigroup + ExchangeData, G::Timestamp: Lattice + Ord, Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = ((D1, ()), G::Timestamp, R), Time = G::Timestamp> + 'static,

source§

fn consolidate_named<Ba>(self, name: &str) -> Self
where D1: ExchangeData + Hash, R: Semigroup + ExchangeData, G::Timestamp: Lattice + Ord, Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = ((D1, ()), G::Timestamp, R), Time = G::Timestamp> + 'static,

Implementors§