pub struct DagWatermarkTracker { /* private fields */ }Expand description
Vec-indexed O(1) watermark tracker for DAG pipelines.
Propagates watermarks through the DAG using min-semantics: a node’s effective watermark is the minimum of its input sources. Uses pre-allocated vectors for Ring 0 compatibility.
Implementations§
Source§impl DagWatermarkTracker
impl DagWatermarkTracker
Sourcepub fn from_dag(dag: &StreamingDag) -> Self
pub fn from_dag(dag: &StreamingDag) -> Self
Builds a watermark tracker from a finalized DAG.
Extracts the adjacency structure and execution order from the DAG for efficient watermark propagation.
Sourcepub fn update_watermark(&mut self, source: NodeId, wm: i64) -> &[(NodeId, i64)]
pub fn update_watermark(&mut self, source: NodeId, wm: i64) -> &[(NodeId, i64)]
Updates a source node’s watermark and propagates downstream.
Returns a slice of (NodeId, new_watermark) pairs for all nodes
whose effective watermark changed as a result of this update.
The returned slice is valid until the next call to update_watermark.
Sourcepub fn get_watermark(&self, node: NodeId) -> Option<i64>
pub fn get_watermark(&self, node: NodeId) -> Option<i64>
Returns the current watermark for a node, or None if unset.
Sourcepub fn effective_watermark(&self, node: NodeId) -> Option<i64>
pub fn effective_watermark(&self, node: NodeId) -> Option<i64>
Returns the effective watermark for a node (min of its inputs).
For source nodes (no inputs), returns the node’s own watermark.
Returns None if any input has not yet received a watermark.
Sourcepub fn checkpoint(&self) -> DagWatermarkCheckpoint
pub fn checkpoint(&self) -> DagWatermarkCheckpoint
Creates a checkpoint of the current watermark state.
Sourcepub fn restore(&mut self, checkpoint: &DagWatermarkCheckpoint)
pub fn restore(&mut self, checkpoint: &DagWatermarkCheckpoint)
Restores watermark state from a checkpoint.
Sourcepub fn slot_count(&self) -> usize
pub fn slot_count(&self) -> usize
Returns the number of node slots allocated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DagWatermarkTracker
impl RefUnwindSafe for DagWatermarkTracker
impl Send for DagWatermarkTracker
impl Sync for DagWatermarkTracker
impl Unpin for DagWatermarkTracker
impl UnsafeUnpin for DagWatermarkTracker
impl UnwindSafe for DagWatermarkTracker
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