@@ -29,6 +29,7 @@ use ballista_core::serde::protobuf::ExecutorRegistration;
2929use ballista_core:: serde:: scheduler:: PartitionId ;
3030use ballista_core:: ConfigProducer ;
3131use ballista_core:: RuntimeProducer ;
32+ use crate :: status_store:: ExecutorStatusStore ;
3233use dashmap:: DashMap ;
3334use datafusion:: execution:: context:: TaskContext ;
3435use datafusion:: execution:: runtime_env:: RuntimeEnv ;
@@ -85,6 +86,9 @@ pub struct Executor {
8586 /// Execution engine that the executor will delegate to
8687 /// for executing query stages
8788 pub ( crate ) execution_engine : Arc < dyn ExecutionEngine > ,
89+
90+ /// Stores task status updates for scheduler polling.
91+ status_store : Arc < ExecutorStatusStore > ,
8892}
8993
9094impl Executor {
@@ -133,6 +137,7 @@ impl Executor {
133137 abort_handles : Default :: default ( ) ,
134138 execution_engine : execution_engine
135139 . unwrap_or_else ( || Arc :: new ( DefaultExecutionEngine { } ) ) ,
140+ status_store : Arc :: new ( ExecutorStatusStore :: new ( ) ) ,
136141 }
137142 }
138143}
@@ -149,6 +154,11 @@ impl Executor {
149154 ( self . config_producer ) ( )
150155 }
151156
157+ #[ must_use]
158+ pub fn status_store ( & self ) -> Arc < ExecutorStatusStore > {
159+ Arc :: clone ( & self . status_store )
160+ }
161+
152162 /// Execute one partition of a query stage and persist the result to disk in IPC format. On
153163 /// success, return a RecordBatch containing metadata about the results, including path
154164 /// and statistics.
0 commit comments