pub struct UnalignedCheckpointer<T> { /* private fields */ }Expand description
State machine for unaligned checkpoints with timeout-based fallback.
Manages the transition between aligned and unaligned checkpoint modes for a single operator with multiple inputs.
§Type Parameter
T is the event type flowing through the operator (e.g., RecordBatch).
Implementations§
Source§impl<T> UnalignedCheckpointer<T>
impl<T> UnalignedCheckpointer<T>
Sourcepub fn new(
num_inputs: usize,
config: UnalignedCheckpointConfig,
is_sink: bool,
) -> Self
pub fn new( num_inputs: usize, config: UnalignedCheckpointConfig, is_sink: bool, ) -> Self
Creates a new unaligned checkpointer.
§Arguments
num_inputs— Number of input channelsconfig— Unaligned checkpoint configurationis_sink— Whether this operator is a sink (disables unaligned mode)
Sourcepub fn aligned_count(&self) -> usize
pub fn aligned_count(&self) -> usize
Returns the current number of aligned inputs (for testing/observability).
Sourcepub fn is_checkpointing(&self) -> bool
pub fn is_checkpointing(&self) -> bool
Returns whether a checkpoint is in progress.
Sourcepub fn buffered_bytes(&self) -> usize
pub fn buffered_bytes(&self) -> usize
Returns the total buffered in-flight bytes.
Sourcepub fn on_barrier(
&mut self,
input_id: usize,
barrier: CheckpointBarrier,
) -> UnalignedAction<T>where
T: Debug,
pub fn on_barrier(
&mut self,
input_id: usize,
barrier: CheckpointBarrier,
) -> UnalignedAction<T>where
T: Debug,
Processes a barrier arriving from the given input.
Returns the action to take. The caller must handle the action (e.g., take a snapshot, forward events, etc.).
Sourcepub fn check_timeout(&mut self) -> Option<UnalignedAction<T>>where
T: Debug,
pub fn check_timeout(&mut self) -> Option<UnalignedAction<T>>where
T: Debug,
Checks whether the alignment timeout has expired.
Call this periodically (e.g., on each event poll) to detect timeout.
Returns Some(UnalignedSnapshot) if timeout triggered.
Sourcepub fn buffer_event(
&mut self,
input_id: usize,
event: T,
size_bytes: usize,
) -> bool
pub fn buffer_event( &mut self, input_id: usize, event: T, size_bytes: usize, ) -> bool
Buffers an event from the given input during alignment.
Returns false if the buffer size would exceed the configured limit
(event is NOT buffered). Returns true on success.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for UnalignedCheckpointer<T>
impl<T> RefUnwindSafe for UnalignedCheckpointer<T>where
T: RefUnwindSafe,
impl<T> Send for UnalignedCheckpointer<T>where
T: Send,
impl<T> Sync for UnalignedCheckpointer<T>where
T: Sync,
impl<T> Unpin for UnalignedCheckpointer<T>where
T: Unpin,
impl<T> UnsafeUnpin for UnalignedCheckpointer<T>
impl<T> UnwindSafe for UnalignedCheckpointer<T>where
T: UnwindSafe,
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