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§
fn on_data(&mut self, batch: RecordBatch)
Sourcefn on_barrier(&mut self, epoch: u64) -> bool
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).
fn on_eos(&mut self)
Provided Methods§
Trait Implementations§
Source§impl Sink for Box<dyn Sink>
impl Sink for Box<dyn Sink>
fn on_data(&mut self, batch: RecordBatch)
Source§fn on_barrier(&mut self, epoch: u64) -> bool
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)
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.fn on_eos(&mut self)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".