Thalweg · API reference ← Main docs

CoverageStore

Trait CoverageStore 

Source
pub trait CoverageStore: Send + Sync {
    // Required methods
    fn record<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        sink: &'life1 SinkId,
        span: &'life2 OffsetSpan,
    ) -> Pin<Box<dyn Future<Output = Result<(), CoverageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn covered<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        sink: &'life1 SinkId,
        topic: &'life2 str,
        partition: i32,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CoveredRange>, CoverageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn gaps<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        sink: &'life1 SinkId,
        topic: &'life2 str,
        partition: i32,
        up_to: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CoveredRange>, CoverageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Per-sink write coverage: record durably-written spans, read covered ranges, and compute the gaps recovery must replay.

Required Methods§

Source

fn record<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, sink: &'life1 SinkId, span: &'life2 OffsetSpan, ) -> Pin<Box<dyn Future<Output = Result<(), CoverageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Record that span was durably written by sink. Merges by union with existing coverage; overlapping/adjacent ranges coalesce. Idempotent.

§Errors

CoverageError::Backend if the durable backing fails.

Source

fn covered<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, sink: &'life1 SinkId, topic: &'life2 str, partition: i32, ) -> Pin<Box<dyn Future<Output = Result<Vec<CoveredRange>, CoverageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The union-merged covered ranges for (sink, topic, partition), ordered by start.

§Errors

CoverageError::Backend if the durable backing fails.

Provided Methods§

Source

fn gaps<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, sink: &'life1 SinkId, topic: &'life2 str, partition: i32, up_to: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<CoveredRange>, CoverageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The gaps in [0, up_to) not yet covered for (sink, topic, partition) — the windows recovery must replay.

§Errors

CoverageError::Backend if the durable backing fails.

Implementors§