pub struct DagCheckpointCoordinator { /* private fields */ }Expand description
Ring 1 checkpoint coordinator.
Orchestrates the checkpoint lifecycle:
trigger_checkpoint()— creates a barrier- Barrier propagates through the DAG (external to this struct)
on_node_snapshot_complete()— each node reports its statefinalize_checkpoint()— produces aDagCheckpointSnapshot
Implementations§
Source§impl DagCheckpointCoordinator
impl DagCheckpointCoordinator
Sourcepub fn new(
source_nodes: Vec<NodeId>,
all_nodes: Vec<NodeId>,
config: DagCheckpointConfig,
) -> Self
pub fn new( source_nodes: Vec<NodeId>, all_nodes: Vec<NodeId>, config: DagCheckpointConfig, ) -> Self
Creates a new checkpoint coordinator.
§Arguments
source_nodes— DAG source node IDs (barrier injection points)all_nodes— all node IDs in the DAGconfig— checkpoint configuration
Sourcepub fn trigger_checkpoint(&mut self) -> Result<CheckpointBarrier, DagError>
pub fn trigger_checkpoint(&mut self) -> Result<CheckpointBarrier, DagError>
Triggers a new checkpoint by creating a barrier.
§Errors
Returns DagError::CheckpointInProgress if a checkpoint is already
in flight.
Sourcepub fn on_node_snapshot_complete(
&mut self,
node_id: NodeId,
state: OperatorState,
) -> bool
pub fn on_node_snapshot_complete( &mut self, node_id: NodeId, state: OperatorState, ) -> bool
Records that a node has completed its snapshot.
Returns true if all nodes have now reported (checkpoint is ready
to finalize).
Sourcepub fn finalize_checkpoint(&mut self) -> Result<DagCheckpointSnapshot, DagError>
pub fn finalize_checkpoint(&mut self) -> Result<DagCheckpointSnapshot, DagError>
Finalizes the current checkpoint, producing a snapshot.
§Errors
Returns DagError::NoCheckpointInProgress if no checkpoint is active.
Returns DagError::CheckpointIncomplete if not all nodes have reported.
Sourcepub fn is_checkpoint_in_progress(&self) -> bool
pub fn is_checkpoint_in_progress(&self) -> bool
Returns whether a checkpoint is currently in progress.
Sourcepub fn completed_snapshots(&self) -> &[DagCheckpointSnapshot]
pub fn completed_snapshots(&self) -> &[DagCheckpointSnapshot]
Returns completed snapshots.
Sourcepub fn latest_snapshot(&self) -> Option<&DagCheckpointSnapshot>
pub fn latest_snapshot(&self) -> Option<&DagCheckpointSnapshot>
Returns the latest completed snapshot (if any).
Sourcepub fn current_epoch(&self) -> u64
pub fn current_epoch(&self) -> u64
Returns the current epoch counter (next epoch to be assigned).
Sourcepub fn source_nodes(&self) -> &[NodeId]
pub fn source_nodes(&self) -> &[NodeId]
Returns the source node IDs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DagCheckpointCoordinator
impl RefUnwindSafe for DagCheckpointCoordinator
impl Send for DagCheckpointCoordinator
impl Sync for DagCheckpointCoordinator
impl Unpin for DagCheckpointCoordinator
impl UnsafeUnpin for DagCheckpointCoordinator
impl UnwindSafe for DagCheckpointCoordinator
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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