Struct timely::dataflow::stream::StreamCore

source ·
pub struct StreamCore<S: Scope, C> { /* private fields */ }
Expand description

Abstraction of a stream of C: Container records timestamped with S::Timestamp.

Internally Stream maintains a list of data recipients who should be presented with data produced by the source of the stream.

Implementations§

source§

impl<S: Scope, C: Container> StreamCore<S, C>

source

pub fn connect_to<P: Push<Bundle<S::Timestamp, C>> + 'static>( &self, target: Target, pusher: P, identifier: usize )

Connects the stream to a destination.

The destination is described both by a Target, for progress tracking information, and a P: Push where the records should actually be sent. The identifier is unique to the edge and is used only for logging purposes.

source

pub fn new(source: Source, output: TeeHelper<S::Timestamp, C>, scope: S) -> Self

Allocates a Stream from a supplied Source name and rendezvous point.

source

pub fn name(&self) -> &Source

The name of the stream’s source operator.

source

pub fn scope(&self) -> S

The scope immediately containing the stream.

source

pub fn container<D: Container>(self) -> StreamCore<S, D>
where Self: AsStream<S, D>,

Allows the assertion of a container type, for the benefit of type inference.

Trait Implementations§

source§

impl<S: Scope, C> AsStream<S, C> for StreamCore<S, C>

source§

fn as_stream(self) -> Self

Translate self to a StreamCore.
source§

impl<S: Scope, C: Container> BranchWhen<<S as ScopeParent>::Timestamp> for StreamCore<S, C>

source§

fn branch_when( &self, condition: impl Fn(&S::Timestamp) -> bool + 'static ) -> (Self, Self)

Takes one input stream and splits it into two output streams. For each time, the supplied closure is called. If it returns true, the records for that will be sent to the second returned stream, otherwise they will be sent to the first. Read more
source§

impl<S: Scope, C: Container> Capture<<S as ScopeParent>::Timestamp, C> for StreamCore<S, C>

source§

fn capture_into<P: EventPusher<S::Timestamp, C> + 'static>( &self, event_pusher: P )

Captures a stream of timestamped data for later replay. Read more
source§

fn capture(&self) -> Receiver<Event<T, C>>

Captures a stream using Rust’s MPSC channels.
source§

impl<S: Clone + Scope, C: Clone> Clone for StreamCore<S, C>
where S::Timestamp: Clone,

source§

fn clone(&self) -> StreamCore<S, C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<G: Scope, C: Container> Concat<G, C> for StreamCore<G, C>

source§

fn concat(&self, other: &StreamCore<G, C>) -> StreamCore<G, C>

Merge the contents of two streams. Read more
source§

impl<G: Scope, C: Container> Concatenate<G, C> for StreamCore<G, C>

source§

fn concatenate<I>(&self, sources: I) -> StreamCore<G, C>
where I: IntoIterator<Item = StreamCore<G, C>>,

Merge the contents of multiple streams. Read more
source§

impl<G: Scope, C: Container> ConnectLoop<G, C> for StreamCore<G, C>

source§

fn connect_loop(&self, handle: Handle<G, C>)

Connect a Stream to be the input of a loop variable. Read more
source§

impl<S, C> Debug for StreamCore<S, C>
where S: Scope,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<G: Scope, T: Timestamp + Refines<G::Timestamp>, C: Data + Container> Enter<G, T, C> for StreamCore<G, C>

source§

fn enter<'a>(&self, scope: &Child<'a, G, T>) -> StreamCore<Child<'a, G, T>, C>

Moves the Stream argument into a child of its current Scope. Read more
source§

impl<G: Scope, C> Exchange<C> for StreamCore<G, C>

source§

fn exchange<F>(&self, route: F) -> StreamCore<G, C>
where for<'a> F: FnMut(&C::Item<'a>) -> u64 + 'static,

Exchange records between workers. Read more
source§

impl<G: Scope, C: PushContainer> Filter<C> for StreamCore<G, C>
where for<'a> C::Item<'a>: PushInto<C>,

source§

fn filter<P: FnMut(&C::Item<'_>) -> bool + 'static>( &self, predicate: P ) -> StreamCore<G, C>

Returns a new instance of self containing only records satisfying predicate. Read more
source§

impl<G: Scope, C: Container> Inspect<G, C> for StreamCore<G, C>

source§

fn inspect_core<F>(&self, func: F) -> Self
where F: FnMut(Result<(&G::Timestamp, &C), &[G::Timestamp]>) + 'static,

Runs a supplied closure on each observed data batch, and each frontier advancement. Read more
source§

fn inspect<F>(&self, func: F) -> Self
where for<'a> F: FnMut(C::ItemRef<'a>) + 'static,

Runs a supplied closure on each observed data element. Read more
source§

fn inspect_time<F>(&self, func: F) -> Self
where for<'a> F: FnMut(&G::Timestamp, C::ItemRef<'a>) + 'static,

Runs a supplied closure on each observed data element and associated time. Read more
source§

fn inspect_batch(&self, func: impl FnMut(&G::Timestamp, &C) + 'static) -> Self

Runs a supplied closure on each observed data batch (time and data slice). Read more
source§

impl<G: Scope, C: Container> InspectCore<G, C> for StreamCore<G, C>

source§

fn inspect_container<F>(&self, func: F) -> StreamCore<G, C>
where F: FnMut(Result<(&G::Timestamp, &C), &[G::Timestamp]>) + 'static,

Runs a supplied closure on each observed container, and each frontier advancement. Read more
source§

impl<'a, G: Scope, C: Clone + Container, T: Timestamp + Refines<G::Timestamp>> Leave<G, C> for StreamCore<Child<'a, G, T>, C>

source§

fn leave(&self) -> StreamCore<G, C>

Moves a Stream to the parent of its current Scope. Read more
source§

impl<S: Scope, C: Container> Map<S, C> for StreamCore<S, C>

source§

fn flat_map<C2, I, L>(&self, logic: L) -> StreamCore<S, C2>
where C2: PushContainer, I: IntoIterator, I::Item: PushInto<C2>, L: FnMut(C::Item<'_>) -> I + 'static,

Consumes each element of the stream and yields some number of new elements. Read more
source§

fn map<C2, D2, L>(&self, logic: L) -> StreamCore<S, C2>
where C2: PushContainer, D2: PushInto<C2>, L: FnMut(C::Item<'_>) -> D2 + 'static,

Consumes each element of the stream and yields a new element. Read more
source§

impl<S: Scope, C: Container> OkErr<S, C> for StreamCore<S, C>

source§

fn ok_err<C1, D1, C2, D2, L>( &self, logic: L ) -> (StreamCore<S, C1>, StreamCore<S, C2>)
where C1: PushContainer, D1: PushInto<C1>, C2: PushContainer, D2: PushInto<C2>, L: FnMut(C::Item<'_>) -> Result<D1, D2> + 'static,

Takes one input stream and splits it into two output streams. For each record, the supplied closure is called with the data. If it returns Ok(x), then x will be sent to the first returned stream; otherwise, if it returns Err(e), then e will be sent to the second. Read more
source§

impl<G: Scope, C1: Container> Operator<G, C1> for StreamCore<G, C1>

source§

fn unary_frontier<C2, B, L, P>( &self, pact: P, name: &str, constructor: B ) -> StreamCore<G, C2>
where C2: Container, B: FnOnce(Capability<G::Timestamp>, OperatorInfo) -> L, L: FnMut(&mut FrontieredInputHandleCore<'_, G::Timestamp, C1, P::Puller>, &mut OutputHandleCore<'_, G::Timestamp, C2, Tee<G::Timestamp, C2>>) + 'static, P: ParallelizationContract<G::Timestamp, C1>,

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. logic can read from the input stream, write to the output stream, and inspect the frontier at the input. Read more
source§

fn unary_notify<C2: Container, L: FnMut(&mut InputHandleCore<G::Timestamp, C1, P::Puller>, &mut OutputHandleCore<'_, G::Timestamp, C2, Tee<G::Timestamp, C2>>, &mut Notificator<'_, G::Timestamp>) + 'static, P: ParallelizationContract<G::Timestamp, C1>>( &self, pact: P, name: &str, init: impl IntoIterator<Item = G::Timestamp>, logic: L ) -> StreamCore<G, C2>

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. logic can read from the input stream, write to the output stream, and inspect the frontier at the input. Read more
source§

fn unary<C2, B, L, P>( &self, pact: P, name: &str, constructor: B ) -> StreamCore<G, C2>
where C2: Container, B: FnOnce(Capability<G::Timestamp>, OperatorInfo) -> L, L: FnMut(&mut InputHandleCore<G::Timestamp, C1, P::Puller>, &mut OutputHandleCore<'_, G::Timestamp, C2, Tee<G::Timestamp, C2>>) + 'static, P: ParallelizationContract<G::Timestamp, C1>,

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. logic can read from the input stream, and write to the output stream. Read more
source§

fn binary_frontier<C2, C3, B, L, P1, P2>( &self, other: &StreamCore<G, C2>, pact1: P1, pact2: P2, name: &str, constructor: B ) -> StreamCore<G, C3>
where C2: Container, C3: Container, B: FnOnce(Capability<G::Timestamp>, OperatorInfo) -> L, L: FnMut(&mut FrontieredInputHandleCore<'_, G::Timestamp, C1, P1::Puller>, &mut FrontieredInputHandleCore<'_, G::Timestamp, C2, P2::Puller>, &mut OutputHandleCore<'_, G::Timestamp, C3, Tee<G::Timestamp, C3>>) + 'static, P1: ParallelizationContract<G::Timestamp, C1>, P2: ParallelizationContract<G::Timestamp, C2>,

Creates a new dataflow operator that partitions its input streams by a parallelization strategy pact, and repeatedly invokes logic, the function returned by the function passed as constructor. logic can read from the input streams, write to the output stream, and inspect the frontier at the inputs. Read more
source§

fn binary_notify<C2: Container, C3: Container, L: FnMut(&mut InputHandleCore<G::Timestamp, C1, P1::Puller>, &mut InputHandleCore<G::Timestamp, C2, P2::Puller>, &mut OutputHandleCore<'_, G::Timestamp, C3, Tee<G::Timestamp, C3>>, &mut Notificator<'_, G::Timestamp>) + 'static, P1: ParallelizationContract<G::Timestamp, C1>, P2: ParallelizationContract<G::Timestamp, C2>>( &self, other: &StreamCore<G, C2>, pact1: P1, pact2: P2, name: &str, init: impl IntoIterator<Item = G::Timestamp>, logic: L ) -> StreamCore<G, C3>

Creates a new dataflow operator that partitions its input streams by a parallelization strategy pact, and repeatedly invokes logic, the function returned by the function passed as constructor. logic can read from the input streams, write to the output stream, and inspect the frontier at the inputs. Read more
source§

fn binary<C2, C3, B, L, P1, P2>( &self, other: &StreamCore<G, C2>, pact1: P1, pact2: P2, name: &str, constructor: B ) -> StreamCore<G, C3>
where C2: Container, C3: Container, B: FnOnce(Capability<G::Timestamp>, OperatorInfo) -> L, L: FnMut(&mut InputHandleCore<G::Timestamp, C1, P1::Puller>, &mut InputHandleCore<G::Timestamp, C2, P2::Puller>, &mut OutputHandleCore<'_, G::Timestamp, C3, Tee<G::Timestamp, C3>>) + 'static, P1: ParallelizationContract<G::Timestamp, C1>, P2: ParallelizationContract<G::Timestamp, C2>,

Creates a new dataflow operator that partitions its input streams by a parallelization strategy pact, and repeatedly invokes logic, the function returned by the function passed as constructor. logic can read from the input streams, write to the output stream, and inspect the frontier at the inputs. Read more
source§

fn sink<L, P>(&self, pact: P, name: &str, logic: L)
where L: FnMut(&mut FrontieredInputHandleCore<'_, G::Timestamp, C1, P::Puller>) + 'static, P: ParallelizationContract<G::Timestamp, C1>,

Creates a new dataflow operator that partitions its input stream by a parallelization strategy pact, and repeatedly invokes the function logic which can read from the input stream and inspect the frontier at the input. Read more
source§

impl<G: Scope, C: Container> Probe<G, C> for StreamCore<G, C>

source§

fn probe(&self) -> Handle<G::Timestamp>

Constructs a progress probe which indicates which timestamps have elapsed at the operator. Read more
source§

fn probe_with(&self, handle: &Handle<G::Timestamp>) -> StreamCore<G, C>

Inserts a progress probe in a stream. Read more
source§

impl<S: Scope, C: Container> Reclock<S> for StreamCore<S, C>

source§

fn reclock<TC: Container>(&self, clock: &StreamCore<S, TC>) -> StreamCore<S, C>

Delays records until an input is observed on the clock input. Read more
source§

impl<S: Scope, C: Container> SharedStream<S, C> for StreamCore<S, C>

source§

fn shared(&self) -> StreamCore<S, Rc<C>>

Convert a stream into a stream of shared data Read more

Auto Trait Implementations§

§

impl<S, C> Freeze for StreamCore<S, C>
where S: Freeze,

§

impl<S, C> !RefUnwindSafe for StreamCore<S, C>

§

impl<S, C> !Send for StreamCore<S, C>

§

impl<S, C> !Sync for StreamCore<S, C>

§

impl<S, C> Unpin for StreamCore<S, C>
where S: Unpin,

§

impl<S, C> !UnwindSafe for StreamCore<S, C>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<R, O, T> CopyOnto<ConsecutiveOffsetPairs<R, O>> for T
where R: Region<Index = (usize, usize)>, O: OffsetContainer<usize>, T: CopyOnto<R>,

source§

fn copy_onto( self, target: &mut ConsecutiveOffsetPairs<R, O> ) -> <ConsecutiveOffsetPairs<R, O> as Region>::Index

Copy self into the target container, returning an index that allows to look up the corresponding read item.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ProgressEventTimestamp for T
where T: Data + Debug + Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Upcasts this ProgressEventTimestamp to Any. Read more
source§

fn type_name(&self) -> &'static str

Returns the name of the concrete type of this object. Read more
source§

impl<R, T> PushInto<FlatStack<R>> for T
where R: Region + Clone + 'static, T: CopyOnto<R>,

source§

fn push_into(self, target: &mut FlatStack<R>)

Push self into the target container.
source§

impl<T> PushInto<Vec<T>> for T

source§

fn push_into(self, target: &mut Vec<T>)

Push self into the target container.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Data for T
where T: Clone + 'static,