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<(u32, TaskState, Option<u32>, 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Pointer = u32

Source§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool