risingwave_connector::sink::writer

Trait SinkWriter

source
pub trait SinkWriter: Send + 'static {
    type CommitMetadata: Send = ();

    // Required methods
    fn begin_epoch<'life0, 'async_trait>(
        &'life0 mut self,
        epoch: u64,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn write_batch<'life0, 'async_trait>(
        &'life0 mut self,
        chunk: StreamChunk,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn barrier<'life0, 'async_trait>(
        &'life0 mut self,
        is_checkpoint: bool,
    ) -> Pin<Box<dyn Future<Output = Result<Self::CommitMetadata>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn abort<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn update_vnode_bitmap<'life0, 'async_trait>(
        &'life0 mut self,
        _vnode_bitmap: Arc<Bitmap>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Provided Associated Types§

Required Methods§

source

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

Begin a new epoch

source

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

Write a stream chunk to sink

source

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

Receive a barrier and mark the end of current epoch. When is_checkpoint is true, the sink writer should commit the current epoch.

Provided Methods§

source

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

Clean up

source

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

Update the vnode bitmap of current sink writer

Implementors§