Skip to main content

CoordinatedCommitter

Trait CoordinatedCommitter 

Source
pub trait CoordinatedCommitter: Send + Sync {
    // Required methods
    fn commit_aggregated<'life0, 'async_trait>(
        &'life0 self,
        batch: CoordinatedCommitBatch,
        context: CoordinatedCommitContext,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConnectorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn committed_cursor<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 CoordinatedCommitNamespace,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CoordinatedCommitCursor>, ConnectorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Leader-side commit for checkpoint-committable sinks.

The designated committer aggregates every writer’s pre_commit descriptor for an epoch into one external commit. Must be idempotent: re-running with the same inputs after a leader failover is a no-op once the target already reflects the epoch.

Required Methods§

Source

fn commit_aggregated<'life0, 'async_trait>( &'life0 self, batch: CoordinatedCommitBatch, context: CoordinatedCommitContext, ) -> Pin<Box<dyn Future<Output = Result<(), ConnectorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Atomically commit the validated participant markers and advance the namespaced external cursor to the batch’s exact target. Empty markers still advance the cursor.

Source

fn committed_cursor<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 CoordinatedCommitNamespace, ) -> Pin<Box<dyn Future<Output = Result<Option<CoordinatedCommitCursor>, ConnectorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Highest checkpoint and fencing authority committed in namespace. A metadata read error must be returned, never converted to an absent cursor, because that could duplicate a previously committed batch.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§