Thalweg · API reference ← Main docs

Sink

Trait Sink 

Source
pub trait Sink: Send {
    // Required methods
    fn send<'life0, 'async_trait>(
        &'life0 mut self,
        batch: RecordBatch,
        span: OffsetSpan,
    ) -> Pin<Box<dyn Future<Output = Result<Receipt, SinkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn flush<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), SinkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A transport-neutral sink: accept Arrow batches fire-and-forget, confirm durability out of band.

Required Methods§

Source

fn send<'life0, 'async_trait>( &'life0 mut self, batch: RecordBatch, span: OffsetSpan, ) -> Pin<Box<dyn Future<Output = Result<Receipt, SinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Accept batch covering source positions span, returning as soon as the transport accepts it. Must not block on durable acknowledgement.

§Errors

SinkError if the batch is rejected at the write boundary or the transport fails to accept it.

Source

fn flush<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), SinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Drain to durability: await outstanding acknowledgements. Used at shutdown and at explicit checkpoint boundaries, not on the hot path.

§Errors

SinkError if the drain fails.

Implementors§