risingwave_stream::executor::dispatch

Trait Dispatcher

source
pub trait Dispatcher: Debug + 'static {
    // Required methods
    fn dispatch_data(&mut self, chunk: StreamChunk) -> impl DispatchFuture<'_>;
    fn dispatch_barrier(
        &mut self,
        barrier: DispatcherBarrier,
    ) -> impl DispatchFuture<'_>;
    fn dispatch_watermark(
        &mut self,
        watermark: Watermark,
    ) -> impl DispatchFuture<'_>;
    fn add_outputs(&mut self, outputs: impl IntoIterator<Item = BoxedOutput>);
    fn remove_outputs(&mut self, actor_ids: &HashSet<ActorId>);
    fn dispatcher_id(&self) -> DispatcherId;
    fn dispatcher_id_str(&self) -> &str;
    fn is_empty(&self) -> bool;
}

Required Methods§

source

fn dispatch_data(&mut self, chunk: StreamChunk) -> impl DispatchFuture<'_>

Dispatch a data chunk to downstream actors.

source

fn dispatch_barrier( &mut self, barrier: DispatcherBarrier, ) -> impl DispatchFuture<'_>

Dispatch a barrier to downstream actors, generally by broadcasting it.

source

fn dispatch_watermark( &mut self, watermark: Watermark, ) -> impl DispatchFuture<'_>

Dispatch a watermark to downstream actors, generally by broadcasting it.

source

fn add_outputs(&mut self, outputs: impl IntoIterator<Item = BoxedOutput>)

Add new outputs to the dispatcher.

source

fn remove_outputs(&mut self, actor_ids: &HashSet<ActorId>)

Remove outputs to actor_ids from the dispatcher.

source

fn dispatcher_id(&self) -> DispatcherId

The ID of the dispatcher. A DispatchExecutor may have multiple dispatchers with different IDs.

Note that the dispatcher id is always equal to the downstream fragment id. See also proto/stream_plan.proto.

source

fn dispatcher_id_str(&self) -> &str

Dispatcher id in string. See Dispatcher::dispatcher_id.

source

fn is_empty(&self) -> bool

Whether the dispatcher has no outputs. If so, it’ll be cleaned up from the DispatchExecutor.

Object Safety§

This trait is not object safe.

Implementors§