pub struct Running { /* private fields */ }Expand description
A started dataflow: issue epochs, commit them, stop it, join it.
Implementations§
Source§impl Running
impl Running
Sourcepub fn task_states(&self) -> Vec<(u32, TaskState, Option<u32>, i64)>
pub fn task_states(&self) -> Vec<(u32, TaskState, Option<u32>, i64)>
Every task’s current state: (task, state, send target, milliseconds in that state).
pub fn n_tasks(&self) -> usize
Sourcepub fn tracker(&self) -> EpochTracker
pub fn tracker(&self) -> EpochTracker
A tracker for the tasks this worker runs (every task for a solo run).
Sourcepub fn inject_epoch(&self, epoch: u64)
pub fn inject_epoch(&self, epoch: u64)
Issue a barrier for a specific epoch to this worker’s sources, setting the local epoch to
it. A joined worker calls this when the leader injects epoch e, so every worker’s sources
stamp the same epoch — the barrier then aligns across a cross-worker shuffle. (The leader
uses Running::barrier to pick e, then tells the workers to inject it.)
Sourcepub fn commit(&self, epoch: u64)
pub fn commit(&self, epoch: u64)
Every task reported epoch: the sources may commit the positions they recorded at it.
Sourcepub fn signal_stop(&self)
pub fn signal_stop(&self)
Tell the sources to stop (Eos flows behind the last data) — WITHOUT issuing a barrier, unlike
Running::stop. A clustered run uses this at shutdown: the final epoch was already issued
and committed by the leader-coordinated round, so a fresh uncommitted barrier here would leave
the sources waiting for a commit that never comes.
Sourcepub fn stop(&self) -> u64
pub fn stop(&self) -> u64
Stop: no more periodic epochs, one final barrier, then Stop to every source (Eos flows
downstream in order behind the barrier). Returns the final epoch. Idempotent.
Sourcepub fn finish(
&self,
events: &Receiver<Event>,
tracker: &mut EpochTracker,
on_epoch: impl FnMut(Completed) -> Result<(), String>,
) -> Result<(), String>
pub fn finish( &self, events: &Receiver<Event>, tracker: &mut EpochTracker, on_epoch: impl FnMut(Completed) -> Result<(), String>, ) -> Result<(), String>
Drive events until every task finished: a completed epoch is committed to the sources
and handed to on_epoch with its snapshots; a task’s failure stops the graph and is the
result. Call after stop (or for a graph whose sources are bounded).
Auto Trait Implementations§
impl !Freeze for Running
impl RefUnwindSafe for Running
impl Send for Running
impl Sync for Running
impl Unpin for Running
impl UnsafeUnpin for Running
impl UnwindSafe for Running
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more