risingwave_stream::executor::aggregation::agg_state_cache

Trait AggStateCache

source
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§

source

fn is_synced(&self) -> bool

Check if the cache is synced with state table.

source

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.

source

fn begin_syncing(&mut self) -> Box<dyn AggStateCacheFiller + Send + Sync + '_>

Begin syncing the cache with state table.

source

fn output_batches( &self, chunk_size: usize, ) -> Box<dyn Iterator<Item = StreamChunk> + '_>

Output batches from the cache.

source

fn output_first(&self) -> Datum

Output the first value.

Implementors§

source§

impl<C> AggStateCache for GenericAggStateCache<C>
where C: StateCache<Key = MemcmpEncoded, Value = CacheValue>, for<'a> C::Filler<'a>: Send + Sync,