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<(TaskId, TaskState, Option<TaskId>, i64)>
pub fn task_states(&self) -> Vec<(TaskId, TaskState, Option<TaskId>, 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).