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<DCB, ECB, D2, E, I, L>(
&self,
name: &str,
logic: L,
) -> (Collection<G, D2, R>, Collection<G, E, R>)
where DCB: ContainerBuilder<Container = Vec<(D2, G::Timestamp, R)>> + PushInto<(D2, G::Timestamp, R)>,
ECB: ContainerBuilder<Container = Vec<(E, G::Timestamp, R)>> + PushInto<(E, G::Timestamp, R)>,
D2: Data,
E: Data,
I: IntoIterator<Item = Result<D2, E>>,
L: FnMut(D1) -> I + 'static;
fn expire_collection_at(
&self,
name: &str,
expiration: G::Timestamp,
token: Weak<()>,
) -> Collection<G, D1, R>;
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 + Columnation,
R: Semigroup + ExchangeData + Columnation,
G::Timestamp: Lattice + Columnation,
Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = TimelyStack<((D1, ()), G::Timestamp, R)>, Time = G::Timestamp> + 'static;
fn consolidate_named<Ba>(self, name: &str) -> Self
where D1: ExchangeData + Hash + Columnation,
R: Semigroup + ExchangeData + Columnation,
G::Timestamp: Lattice + Columnation,
Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = TimelyStack<((D1, ()), G::Timestamp, R)>, Time = G::Timestamp> + 'static;
// Provided method
fn map_fallible<DCB, ECB, D2, E, L>(
&self,
name: &str,
logic: L,
) -> (Collection<G, D2, R>, Collection<G, E, R>)
where DCB: ContainerBuilder<Container = Vec<(D2, G::Timestamp, R)>> + PushInto<(D2, G::Timestamp, R)>,
ECB: ContainerBuilder<Container = Vec<(E, G::Timestamp, R)>> + PushInto<(E, G::Timestamp, R)>,
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<DCB, ECB, D2, E, I, L>(
&self,
name: &str,
logic: L,
) -> (Collection<G, D2, R>, Collection<G, E, R>)where
DCB: ContainerBuilder<Container = Vec<(D2, G::Timestamp, R)>> + PushInto<(D2, G::Timestamp, R)>,
ECB: ContainerBuilder<Container = Vec<(E, G::Timestamp, R)>> + PushInto<(E, G::Timestamp, R)>,
D2: Data,
E: Data,
I: IntoIterator<Item = Result<D2, E>>,
L: FnMut(D1) -> I + 'static,
fn flat_map_fallible<DCB, ECB, D2, E, I, L>(
&self,
name: &str,
logic: L,
) -> (Collection<G, D2, R>, Collection<G, E, R>)where
DCB: ContainerBuilder<Container = Vec<(D2, G::Timestamp, R)>> + PushInto<(D2, G::Timestamp, R)>,
ECB: ContainerBuilder<Container = Vec<(E, G::Timestamp, R)>> + PushInto<(E, G::Timestamp, R)>,
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.
sourcefn expire_collection_at(
&self,
name: &str,
expiration: G::Timestamp,
token: Weak<()>,
) -> Collection<G, D1, R>
fn expire_collection_at( &self, name: &str, expiration: G::Timestamp, token: Weak<()>, ) -> Collection<G, D1, R>
Block progress of the frontier at expiration
time, unless the token is dropped.
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) -> Selfwhere
D1: ExchangeData + Hash + Columnation,
R: Semigroup + ExchangeData + Columnation,
G::Timestamp: Lattice + Columnation,
Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = TimelyStack<((D1, ()), G::Timestamp, R)>, Time = G::Timestamp> + 'static,
fn consolidate_named_if<Ba>(self, must_consolidate: bool, name: &str) -> Selfwhere
D1: ExchangeData + Hash + Columnation,
R: Semigroup + ExchangeData + Columnation,
G::Timestamp: Lattice + Columnation,
Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = TimelyStack<((D1, ()), G::Timestamp, R)>, Time = G::Timestamp> + 'static,
Consolidates the collection if must_consolidate
is true
and leaves it
untouched otherwise.
sourcefn consolidate_named<Ba>(self, name: &str) -> Selfwhere
D1: ExchangeData + Hash + Columnation,
R: Semigroup + ExchangeData + Columnation,
G::Timestamp: Lattice + Columnation,
Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = TimelyStack<((D1, ()), G::Timestamp, R)>, Time = G::Timestamp> + 'static,
fn consolidate_named<Ba>(self, name: &str) -> Selfwhere
D1: ExchangeData + Hash + Columnation,
R: Semigroup + ExchangeData + Columnation,
G::Timestamp: Lattice + Columnation,
Ba: Batcher<Input = Vec<((D1, ()), G::Timestamp, R)>, Output = TimelyStack<((D1, ()), G::Timestamp, R)>, Time = G::Timestamp> + 'static,
Consolidates the collection.
Provided Methods§
sourcefn map_fallible<DCB, ECB, D2, E, L>(
&self,
name: &str,
logic: L,
) -> (Collection<G, D2, R>, Collection<G, E, R>)
fn map_fallible<DCB, ECB, 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.
Callers need to specify the following type parameters:
DCB
: The container builder for theOk
output.ECB
: The container builder for theErr
output.