Skip to main content

Sink

Trait Sink 

Source
pub trait Sink: Send {
    // Required methods
    fn on_data(&mut self, batch: RecordBatch);
    fn on_barrier(&mut self, epoch: u64) -> bool;
    fn on_eos(&mut self);

    // Provided method
    fn on_commit(&mut self, _epoch: u64) { ... }
}
Expand description

A sink consumes batches and acks barriers.

Required Methods§

Source

fn on_data(&mut self, batch: RecordBatch)

Source

fn on_barrier(&mut self, epoch: u64) -> bool

A barrier: make everything received before it durable. true acks the epoch; false withholds the ack (the epoch never completes, so nothing upstream commits past it).

Source

fn on_eos(&mut self)

Provided Methods§

Source

fn on_commit(&mut self, _epoch: u64)

Every task reported epoch and the coordinator made it durable: an exactly-once sink commits the transaction that carried the epoch’s output here.

Trait Implementations§

Source§

impl Sink for Box<dyn Sink>

Source§

fn on_data(&mut self, batch: RecordBatch)

Source§

fn on_barrier(&mut self, epoch: u64) -> bool

A barrier: make everything received before it durable. true acks the epoch; false withholds the ack (the epoch never completes, so nothing upstream commits past it).
Source§

fn on_commit(&mut self, epoch: u64)

Every task reported epoch and the coordinator made it durable: an exactly-once sink commits the transaction that carried the epoch’s output here.
Source§

fn on_eos(&mut self)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Sink for Box<dyn Sink>

Source§

fn on_data(&mut self, batch: RecordBatch)

Source§

fn on_barrier(&mut self, epoch: u64) -> bool

Source§

fn on_commit(&mut self, epoch: u64)

Source§

fn on_eos(&mut self)

Implementors§