Skip to main content

Running

Struct Running 

Source
pub struct Running { /* private fields */ }
Expand description

A started dataflow: issue epochs, commit them, stop it, join it.

Implementations§

Source§

impl Running

Source

pub fn task_states(&self) -> Vec<(TaskId, TaskState, Option<TaskId>, i64)>

Every task’s current state: (task, state, send target, milliseconds in that state).

Source

pub fn n_tasks(&self) -> usize

Source

pub fn tracker(&self) -> EpochTracker

A tracker for the tasks this worker runs (every task for a solo run).

Source

pub fn barrier(&self) -> u64

Issue the next epoch now (a barrier to every source); returns it.

Source

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.)

Source

pub fn epoch(&self) -> u64

The last epoch issued.

Source

pub fn commit(&self, epoch: u64)

Every task reported epoch: the sources may commit the positions they recorded at it.

Source

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.

Source

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.

Source

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).

Source

pub fn join(&self)

Join every task. Closes the control channels first, so a source waiting for a final commit that will never come (the coordinator gave up) still exits — uncommitted means replay.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.