risingwave_batch::task

Trait BatchTaskContext

source
pub trait BatchTaskContext:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn get_task_output(
        &self,
        task_output_id: TaskOutputId,
    ) -> Result<TaskOutput>;
    fn catalog_reader(&self) -> SysCatalogReaderRef;
    fn is_local_addr(&self, peer_addr: &HostAddr) -> bool;
    fn dml_manager(&self) -> DmlManagerRef;
    fn state_store(&self) -> StateStoreImpl;
    fn batch_metrics(&self) -> Option<BatchMetrics>;
    fn spill_metrics(&self) -> Arc<BatchSpillMetrics>;
    fn client_pool(&self) -> ComputeClientPoolRef;
    fn get_config(&self) -> &BatchConfig;
    fn source_metrics(&self) -> Arc<SourceMetrics>;
    fn create_executor_mem_context(&self, executor_id: &str) -> MemoryContext;
    fn worker_node_manager(&self) -> Option<WorkerNodeManagerRef>;
}
Expand description

Context for batch task execution.

This context is specific to one task execution, and should not be shared by different tasks.

Required Methods§

source

fn get_task_output(&self, task_output_id: TaskOutputId) -> Result<TaskOutput>

Get task output identified by task_output_id.

Returns error if the task of task_output_id doesn’t run in same worker as current task.

source

fn catalog_reader(&self) -> SysCatalogReaderRef

Get system catalog reader, used to read system table.

source

fn is_local_addr(&self, peer_addr: &HostAddr) -> bool

Whether peer_addr is in same as current task.

source

fn dml_manager(&self) -> DmlManagerRef

source

fn state_store(&self) -> StateStoreImpl

source

fn batch_metrics(&self) -> Option<BatchMetrics>

Get batch metrics. None indicates that not collect task metrics.

source

fn spill_metrics(&self) -> Arc<BatchSpillMetrics>

source

fn client_pool(&self) -> ComputeClientPoolRef

Get compute client pool. This is used in grpc exchange to avoid creating new compute client for each grpc call.

source

fn get_config(&self) -> &BatchConfig

Get config for batch environment

source

fn source_metrics(&self) -> Arc<SourceMetrics>

source

fn create_executor_mem_context(&self, executor_id: &str) -> MemoryContext

source

fn worker_node_manager(&self) -> Option<WorkerNodeManagerRef>

Object Safety§

This trait is not object safe.

Implementors§