Trait mz_timely_util::operator::CollectionExt
source · pub trait CollectionExt<G, D1, R>{
// 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 Collection
s.
Required Methods§
sourcefn empty(scope: &G) -> Collection<G, D1, R>
fn empty(scope: &G) -> Collection<G, D1, R>
Creates a new empty collection in scope
.
sourcefn flat_map_fallible<D2, E, I, L>(
&self,
name: &str,
logic: L
) -> (Collection<G, D2, R>, Collection<G, E, R>)
fn flat_map_fallible<D2, E, I, L>( &self, name: &str, logic: L ) -> (Collection<G, D2, R>, Collection<G, E, R>)
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.
sourcefn explode_one<D2, R2, L>(
&self,
logic: L
) -> Collection<G, D2, <R2 as Multiply<R>>::Output>
fn explode_one<D2, R2, L>( &self, logic: L ) -> Collection<G, D2, <R2 as Multiply<R>>::Output>
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.
sourcefn ensure_monotonic<E, IE>(
&self,
into_err: IE
) -> (Collection<G, D1, R>, Collection<G, E, R>)
fn ensure_monotonic<E, IE>( &self, into_err: IE ) -> (Collection<G, D1, R>, Collection<G, E, R>)
Partitions the input into a monotonic collection and non-monotone exceptions, with respect to differences.
The exceptions are transformed by into_err
.
sourcefn with_token(&self, token: Weak<()>) -> Collection<G, D1, R>
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.
sourcefn consolidate_named_if<Ba>(self, must_consolidate: bool, name: &str) -> Self
fn consolidate_named_if<Ba>(self, must_consolidate: bool, name: &str) -> Self
Consolidates the collection if must_consolidate
is true
and leaves it
untouched otherwise.
Provided Methods§
sourcefn map_fallible<D2, E, L>(
&self,
name: &str,
logic: L
) -> (Collection<G, D2, R>, Collection<G, E, R>)
fn map_fallible<D2, E, L>( &self, name: &str, logic: L ) -> (Collection<G, D2, R>, Collection<G, E, R>)
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.