pub trait AggStateCache: EstimateSize {
// Required methods
fn is_synced(&self) -> bool;
fn apply_batch(
&mut self,
chunk: &StreamChunk,
cache_key_serializer: &OrderedRowSerde,
arg_col_indices: &[usize],
order_col_indices: &[usize],
);
fn begin_syncing(
&mut self,
) -> Box<dyn AggStateCacheFiller + Send + Sync + '_>;
fn output_batches(
&self,
chunk_size: usize,
) -> Box<dyn Iterator<Item = StreamChunk> + '_>;
fn output_first(&self) -> Datum;
}
Expand description
Trait that defines the interface of state table cache for stateful streaming agg.
Required Methods§
sourcefn apply_batch(
&mut self,
chunk: &StreamChunk,
cache_key_serializer: &OrderedRowSerde,
arg_col_indices: &[usize],
order_col_indices: &[usize],
)
fn apply_batch( &mut self, chunk: &StreamChunk, cache_key_serializer: &OrderedRowSerde, arg_col_indices: &[usize], order_col_indices: &[usize], )
Apply a batch of updates to the cache.
sourcefn begin_syncing(&mut self) -> Box<dyn AggStateCacheFiller + Send + Sync + '_>
fn begin_syncing(&mut self) -> Box<dyn AggStateCacheFiller + Send + Sync + '_>
Begin syncing the cache with state table.
sourcefn output_batches(
&self,
chunk_size: usize,
) -> Box<dyn Iterator<Item = StreamChunk> + '_>
fn output_batches( &self, chunk_size: usize, ) -> Box<dyn Iterator<Item = StreamChunk> + '_>
Output batches from the cache.
sourcefn output_first(&self) -> Datum
fn output_first(&self) -> Datum
Output the first value.