Trait BatchTaskContext

pub trait BatchTaskContext:
    Send
    + Sync
    + 'static {
    // Required methods
    fn get_task_output(
        &self,
        task_output_id: TaskOutputId,
    ) -> Result<TaskOutput, BatchError>;
    fn catalog_reader(&self) -> Arc<dyn SysCatalogReader>;
    fn is_local_addr(&self, peer_addr: &HostAddr) -> bool;
    fn dml_manager(&self) -> Arc<DmlManager>;
    fn state_store(&self) -> StateStoreImpl;
    fn batch_metrics(&self) -> Option<Arc<BatchMetricsInner>>;
    fn spill_metrics(&self) -> Arc<BatchSpillMetrics>;
    fn client_pool(&self) -> Arc<RpcClientPool<ComputeClient>>;
    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<Arc<WorkerNodeManager>>;
}
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§

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

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.

fn catalog_reader(&self) -> Arc<dyn SysCatalogReader>

Get system catalog reader, used to read system table.

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

Whether peer_addr is in same as current task.

fn dml_manager(&self) -> Arc<DmlManager>

fn state_store(&self) -> StateStoreImpl

fn batch_metrics(&self) -> Option<Arc<BatchMetricsInner>>

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

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

fn client_pool(&self) -> Arc<RpcClientPool<ComputeClient>>

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

fn get_config(&self) -> &BatchConfig

Get config for batch environment

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

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

fn worker_node_manager(&self) -> Option<Arc<WorkerNodeManager>>

Implementors§