pub struct StreamCheckpointManager { /* private fields */ }Expand description
Coordinates checkpoint lifecycle for streaming sources and sinks.
Disabled by default. When enabled via StreamCheckpointConfig, the
manager captures atomic counters from registered sources to produce
consistent StreamCheckpoint snapshots.
Implementations§
Source§impl StreamCheckpointManager
impl StreamCheckpointManager
Sourcepub fn new(config: StreamCheckpointConfig) -> Self
pub fn new(config: StreamCheckpointConfig) -> Self
Creates a new checkpoint manager.
If config validation fails, the manager is created in disabled state.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns whether checkpointing is enabled.
Sourcepub fn register_source(
&mut self,
name: &str,
sequence: Arc<AtomicU64>,
watermark: Arc<AtomicI64>,
)
pub fn register_source( &mut self, name: &str, sequence: Arc<AtomicU64>, watermark: Arc<AtomicI64>, )
Registers a source for checkpoint tracking.
The sequence and watermark atomics are shared with the live
Source — reading them is lock-free.
Sourcepub fn register_sink(&mut self, name: &str, position: u64)
pub fn register_sink(&mut self, name: &str, position: u64)
Registers a sink for checkpoint tracking.
Sourcepub fn trigger(&mut self) -> Option<u64>
pub fn trigger(&mut self) -> Option<u64>
Triggers a checkpoint, capturing current source/sink state.
Returns the checkpoint ID, or None if checkpointing is disabled.
Sourcepub fn checkpoint(&mut self) -> Result<Option<u64>, CheckpointError>
pub fn checkpoint(&mut self) -> Result<Option<u64>, CheckpointError>
Creates a checkpoint and returns the checkpoint ID.
§Errors
Returns CheckpointError::Disabled if checkpointing is not enabled.
Sourcepub fn restore(&self) -> Result<&StreamCheckpoint, CheckpointError>
pub fn restore(&self) -> Result<&StreamCheckpoint, CheckpointError>
Returns the most recent checkpoint for restore.
§Errors
Returns CheckpointError::Disabled if checkpointing is not enabled,
or CheckpointError::NoCheckpoint if no checkpoint exists.
Sourcepub fn get_checkpoint(&self, id: u64) -> Option<&StreamCheckpoint>
pub fn get_checkpoint(&self, id: u64) -> Option<&StreamCheckpoint>
Returns a checkpoint by ID.
Sourcepub fn last_checkpoint_id(&self) -> Option<u64>
pub fn last_checkpoint_id(&self) -> Option<u64>
Returns the ID of the most recent checkpoint.
Sourcepub fn changelog(&self) -> Option<&StreamChangelogBuffer>
pub fn changelog(&self) -> Option<&StreamChangelogBuffer>
Returns a reference to the changelog buffer, if configured.
Sourcepub fn changelog_mut(&mut self) -> Option<&mut StreamChangelogBuffer>
pub fn changelog_mut(&mut self) -> Option<&mut StreamChangelogBuffer>
Returns a mutable reference to the changelog buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamCheckpointManager
impl RefUnwindSafe for StreamCheckpointManager
impl Send for StreamCheckpointManager
impl Sync for StreamCheckpointManager
impl Unpin for StreamCheckpointManager
impl UnwindSafe for StreamCheckpointManager
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.