Skip to main content

Ring1Operator

Trait Ring1Operator 

Source
pub trait Ring1Operator: Send {
    // Required methods
    fn process_batch(&mut self, batch: RecordBatch) -> Vec<RecordBatch>;
    fn advance_watermark(&mut self, timestamp: i64) -> Vec<RecordBatch>;
    fn output_schema(&self) -> SchemaRef;
    fn checkpoint(&self) -> Vec<u8> ;
    fn restore(&mut self, state: &[u8]);
}
Expand description

A Ring 1 operator that processes batches at a pipeline boundary.

Implementations handle stateful operations like windowed aggregation, stream joins, and sorting. The operator receives RecordBatches from the upstream compiled segment and produces output batches for the downstream segment.

Required Methods§

Source

fn process_batch(&mut self, batch: RecordBatch) -> Vec<RecordBatch>

Processes an incoming RecordBatch from the upstream compiled segment.

Returns zero or more output batches. For windowed aggregation, output may be empty until a window trigger fires.

Source

fn advance_watermark(&mut self, timestamp: i64) -> Vec<RecordBatch>

Advances the watermark — may trigger window emissions.

Returns any batches emitted by window closure or timer firing.

Source

fn output_schema(&self) -> SchemaRef

Returns the output schema for batches produced by this operator.

Source

fn checkpoint(&self) -> Vec<u8>

Serializes operator state for checkpointing.

Source

fn restore(&mut self, state: &[u8])

Restores operator state from a checkpoint.

Implementors§