Trait mz_timely_util::operator::StreamExt

source ·
pub trait StreamExt<G, D1>
where D1: Data, G: Scope,
{ // Required methods fn unary_fallible<D2, E, B, P>( &self, pact: P, name: &str, constructor: B ) -> (Stream<G, D2>, Stream<G, E>) where D2: Data, E: Data, B: FnOnce(Capability<G::Timestamp>, OperatorInfo) -> Box<dyn FnMut(&mut InputHandle<G::Timestamp, D1, P::Puller>, &mut OutputHandle<'_, G::Timestamp, D2, Tee<G::Timestamp, Vec<D2>>>, &mut OutputHandle<'_, G::Timestamp, E, Tee<G::Timestamp, Vec<E>>>) + 'static>, P: ParallelizationContract<G::Timestamp, Vec<D1>>; fn unary_async<D2, P, B, BFut>( &self, pact: P, name: String, constructor: B ) -> Stream<G, D2> where D2: Data, B: FnOnce(Capability<G::Timestamp>, OperatorInfo, AsyncInputHandle<G::Timestamp, Vec<D1>, ConnectedToOne>, AsyncOutputHandle<G::Timestamp, Vec<D2>, Tee<G::Timestamp, Vec<D2>>>) -> BFut, BFut: Future + 'static, P: ParallelizationContract<G::Timestamp, Vec<D1>>; fn binary_async<D2, D3, P1, P2, B, BFut>( &self, other: &Stream<G, D2>, pact1: P1, pact2: P2, name: String, constructor: B ) -> Stream<G, D3> where D2: Data, D3: Data, B: FnOnce(Capability<G::Timestamp>, OperatorInfo, AsyncInputHandle<G::Timestamp, Vec<D1>, ConnectedToOne>, AsyncInputHandle<G::Timestamp, Vec<D2>, ConnectedToOne>, AsyncOutputHandle<G::Timestamp, Vec<D3>, Tee<G::Timestamp, Vec<D3>>>) -> BFut, BFut: Future + 'static, P1: ParallelizationContract<G::Timestamp, Vec<D1>>, P2: ParallelizationContract<G::Timestamp, Vec<D2>>; fn sink_async<P, B, BFut>(&self, pact: P, name: String, constructor: B) where B: FnOnce(OperatorInfo, AsyncInputHandle<G::Timestamp, Vec<D1>, Disconnected>) -> BFut, BFut: Future + 'static, P: ParallelizationContract<G::Timestamp, Vec<D1>>; fn flat_map_fallible<D2, E, I, L>( &self, name: &str, logic: L ) -> (Stream<G, D2>, Stream<G, E>) where D2: Data, E: Data, I: IntoIterator<Item = Result<D2, E>>, L: FnMut(D1) -> I + 'static; fn pass_through<R: Data>( &self, name: &str, unit: R ) -> Stream<G, (D1, G::Timestamp, R)>; fn with_token(&self, token: Weak<()>) -> Stream<G, D1>; fn distribute(&self) -> Stream<G, D1> where D1: ExchangeData; // Provided method fn map_fallible<D2, E, L>( &self, name: &str, logic: L ) -> (Stream<G, D2>, Stream<G, E>) where D2: Data, E: Data, L: FnMut(D1) -> Result<D2, E> + 'static { ... } }
Expand description

Extension methods for timely Streams.

Required Methods§

source

fn unary_fallible<D2, E, B, P>( &self, pact: P, name: &str, constructor: B ) -> (Stream<G, D2>, Stream<G, E>)
where D2: Data, E: Data, B: FnOnce(Capability<G::Timestamp>, OperatorInfo) -> Box<dyn FnMut(&mut InputHandle<G::Timestamp, D1, P::Puller>, &mut OutputHandle<'_, G::Timestamp, D2, Tee<G::Timestamp, Vec<D2>>>, &mut OutputHandle<'_, G::Timestamp, E, Tee<G::Timestamp, Vec<E>>>) + 'static>, P: ParallelizationContract<G::Timestamp, Vec<D1>>,

Like timely::dataflow::operators::generic::operator::Operator::unary, but the logic function can handle failures.

Creates a new dataflow operator that partitions its input stream by a parallelization strategy pact and repeatedly invokes logic, the function returned by the function passed as constructor. The logic function can read to the input stream and write to either of two output streams, where the first output stream represents successful computations and the second output stream represents failed computations.

source

fn unary_async<D2, P, B, BFut>( &self, pact: P, name: String, constructor: B ) -> Stream<G, D2>

Creates a new dataflow operator that partitions its input stream by a parallelization strategy pact, and repeatedly schedules logic, the future returned by the function passed as constructor. logic can read from the input stream, and write to the output stream.

source

fn binary_async<D2, D3, P1, P2, B, BFut>( &self, other: &Stream<G, D2>, pact1: P1, pact2: P2, name: String, constructor: B ) -> Stream<G, D3>

Creates a new dataflow operator that partitions its input streams by a parallelization strategy pact, and repeatedly schedules logic, the future returned by the function passed as constructor. logic can read from the input streams, and write to the output stream.

source

fn sink_async<P, B, BFut>(&self, pact: P, name: String, constructor: B)
where B: FnOnce(OperatorInfo, AsyncInputHandle<G::Timestamp, Vec<D1>, Disconnected>) -> BFut, BFut: Future + 'static, P: ParallelizationContract<G::Timestamp, Vec<D1>>,

Creates a new dataflow operator that partitions its input stream by a parallelization strategy pact, and repeatedly schedules logic which can read from the input stream and inspect the frontier at the input.

source

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

Like timely::dataflow::operators::map::Map::flat_map, but logic is allowed to fail. The first returned stream will contain the successful applications of logic, while the second returned stream will contain the failed applications.

source

fn pass_through<R: Data>( &self, name: &str, unit: R ) -> Stream<G, (D1, G::Timestamp, R)>

Take a Timely stream and convert it to a Differential stream, where each diff is “1” and each time is the current Timely timestamp.

source

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

Wraps the stream 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 distribute(&self) -> Stream<G, D1>
where D1: ExchangeData,

Distributes the data of the stream to all workers in a round-robin fashion.

Provided Methods§

source

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

Like timely::dataflow::operators::map::Map::map, but logic is allowed to fail. The first returned stream will contain the successful applications of logic, while the second returned stream will contain the failed applications.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<G, D1> StreamExt<G, D1> for Stream<G, D1>
where D1: Data, G: Scope,

source§

fn sink_async<P, B, BFut>(&self, pact: P, name: String, constructor: B)
where B: FnOnce(OperatorInfo, AsyncInputHandle<G::Timestamp, Vec<D1>, Disconnected>) -> BFut, BFut: Future + 'static, P: ParallelizationContract<G::Timestamp, Vec<D1>>,

Creates a new dataflow operator that partitions its input stream by a parallelization strategy pact, and repeatedly schedules logic which can read from the input stream and inspect the frontier at the input.

source§

fn unary_fallible<D2, E, B, P>( &self, pact: P, name: &str, constructor: B ) -> (Stream<G, D2>, Stream<G, E>)
where D2: Data, E: Data, B: FnOnce(Capability<G::Timestamp>, OperatorInfo) -> Box<dyn FnMut(&mut InputHandle<G::Timestamp, D1, P::Puller>, &mut OutputHandle<'_, G::Timestamp, D2, Tee<G::Timestamp, Vec<D2>>>, &mut OutputHandle<'_, G::Timestamp, E, Tee<G::Timestamp, Vec<E>>>) + 'static>, P: ParallelizationContract<G::Timestamp, Vec<D1>>,

source§

fn unary_async<D2, P, B, BFut>( &self, pact: P, name: String, constructor: B ) -> Stream<G, D2>

source§

fn binary_async<D2, D3, P1, P2, B, BFut>( &self, other: &Stream<G, D2>, pact1: P1, pact2: P2, name: String, constructor: B ) -> Stream<G, D3>

source§

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

source§

fn pass_through<R: Data>( &self, name: &str, unit: R ) -> Stream<G, (D1, G::Timestamp, R)>

source§

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

source§

fn distribute(&self) -> Stream<G, D1>
where D1: ExchangeData,

Implementors§