risingwave_stream::executor::top_n::utils

Trait TopNExecutorBase

source
pub trait TopNExecutorBase: Send + 'static {
    // Required methods
    fn apply_chunk(
        &mut self,
        chunk: StreamChunk,
    ) -> impl Future<Output = StreamExecutorResult<Option<StreamChunk>>> + Send;
    fn flush_data(
        &mut self,
        epoch: EpochPair,
    ) -> impl Future<Output = StreamExecutorResult<()>> + Send;
    fn try_flush_data(
        &mut self,
    ) -> impl Future<Output = StreamExecutorResult<()>> + Send;
    fn init(
        &mut self,
        epoch: EpochPair,
    ) -> impl Future<Output = StreamExecutorResult<()>> + Send;
    fn handle_watermark(
        &mut self,
        watermark: Watermark,
    ) -> impl Future<Output = Option<Watermark>> + Send;

    // Provided methods
    fn update_vnode_bitmap(&mut self, _vnode_bitmap: Arc<Bitmap>) { ... }
    fn evict(&mut self) { ... }
}

Required Methods§

source

fn apply_chunk( &mut self, chunk: StreamChunk, ) -> impl Future<Output = StreamExecutorResult<Option<StreamChunk>>> + Send

Apply the chunk to the dirty state and get the diffs. TODO(rc): There can be a 2 times amplification in terms of the chunk size, so we may need to allow apply_chunk return a stream of chunks. Motivation is not quite strong though.

source

fn flush_data( &mut self, epoch: EpochPair, ) -> impl Future<Output = StreamExecutorResult<()>> + Send

Flush the buffered chunk to the storage backend.

source

fn try_flush_data( &mut self, ) -> impl Future<Output = StreamExecutorResult<()>> + Send

Flush the buffered chunk to the storage backend.

source

fn init( &mut self, epoch: EpochPair, ) -> impl Future<Output = StreamExecutorResult<()>> + Send

source

fn handle_watermark( &mut self, watermark: Watermark, ) -> impl Future<Output = Option<Watermark>> + Send

Handle incoming watermarks

Provided Methods§

source

fn update_vnode_bitmap(&mut self, _vnode_bitmap: Arc<Bitmap>)

Update the vnode bitmap for the state table and manipulate the cache if necessary, only used by Group Top-N since it’s distributed.

source

fn evict(&mut self)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<K: HashKey, S: StateStore, const WITH_TIES: bool> TopNExecutorBase for InnerGroupTopNExecutor<K, S, WITH_TIES>
where TopNCache<WITH_TIES>: TopNCacheTrait,

source§

impl<K: HashKey, S: StateStore, const WITH_TIES: bool> TopNExecutorBase for InnerAppendOnlyGroupTopNExecutor<K, S, WITH_TIES>

source§

impl<S: StateStore, const WITH_TIES: bool> TopNExecutorBase for InnerAppendOnlyTopNExecutor<S, WITH_TIES>

source§

impl<S: StateStore, const WITH_TIES: bool> TopNExecutorBase for InnerTopNExecutor<S, WITH_TIES>
where TopNCache<WITH_TIES>: TopNCacheTrait,