risingwave_stream::executor::top_n::top_n_cache

Trait AppendOnlyTopNCacheTrait

source
pub trait AppendOnlyTopNCacheTrait {
    // Required method
    fn insert<S: StateStore>(
        &mut self,
        cache_key: (Vec<u8>, Vec<u8>),
        row_ref: RowRef<'_>,
        staging: &mut TopNStaging,
        managed_state: &mut ManagedTopNState<S>,
        row_deserializer: &RowDeserializer,
    ) -> StreamExecutorResult<()>;
}
Expand description

Similar to TopNCacheTrait, but for append-only TopN.

Required Methods§

source

fn insert<S: StateStore>( &mut self, cache_key: (Vec<u8>, Vec<u8>), row_ref: RowRef<'_>, staging: &mut TopNStaging, managed_state: &mut ManagedTopNState<S>, row_deserializer: &RowDeserializer, ) -> StreamExecutorResult<()>

Insert input row to corresponding cache range according to its order key.

Changes in self.middle is recorded to res_ops and res_rows, which will be used to generate messages to be sent to downstream operators.

managed_state is required because different from normal TopN, append-only TopN doesn’t insert all rows into the state table.

Object Safety§

This trait is not object safe.

Implementors§