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§
sourcefn get_task_output(&self, task_output_id: TaskOutputId) -> Result<TaskOutput>
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.
sourcefn catalog_reader(&self) -> SysCatalogReaderRef
fn catalog_reader(&self) -> SysCatalogReaderRef
Get system catalog reader, used to read system table.
sourcefn is_local_addr(&self, peer_addr: &HostAddr) -> bool
fn is_local_addr(&self, peer_addr: &HostAddr) -> bool
Whether peer_addr
is in same as current task.
fn dml_manager(&self) -> DmlManagerRef
fn state_store(&self) -> StateStoreImpl
sourcefn batch_metrics(&self) -> Option<BatchMetrics>
fn batch_metrics(&self) -> Option<BatchMetrics>
Get batch metrics. None indicates that not collect task metrics.
fn spill_metrics(&self) -> Arc<BatchSpillMetrics>
sourcefn client_pool(&self) -> ComputeClientPoolRef
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.
sourcefn get_config(&self) -> &BatchConfig
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<WorkerNodeManagerRef>
Object Safety§
This trait is not object safe.