@@ -50,6 +50,7 @@ use tonic::transport::Channel;
50
50
type ExecutorClients = Arc < RwLock < HashMap < String , ExecutorGrpcClient < Channel > > > > ;
51
51
type ExecutionGraphCache = Arc < RwLock < HashMap < String , Arc < RwLock < ExecutionGraph > > > > > ;
52
52
53
+ #[ derive( Clone ) ]
53
54
pub struct TaskManager < T : ' static + AsLogicalPlan , U : ' static + AsExecutionPlan > {
54
55
state : Arc < dyn StateBackendClient > ,
55
56
#[ allow( dead_code) ]
@@ -62,22 +63,6 @@ pub struct TaskManager<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>
62
63
pending_task_queue_size : Arc < AtomicUsize > ,
63
64
}
64
65
65
- impl < T : ' static + AsLogicalPlan , U : ' static + AsExecutionPlan > Clone
66
- for TaskManager < T , U >
67
- {
68
- fn clone ( & self ) -> Self {
69
- Self {
70
- state : self . state . clone ( ) ,
71
- clients : self . clients . clone ( ) ,
72
- session_builder : self . session_builder ,
73
- codec : self . codec . clone ( ) ,
74
- scheduler_id : self . scheduler_id . clone ( ) ,
75
- active_job_cache : self . active_job_cache . clone ( ) ,
76
- pending_task_queue_size : AtomicUsize :: new ( self . get_pending_task_queue_size ( ) ) ,
77
- }
78
- }
79
- }
80
-
81
66
impl < T : ' static + AsLogicalPlan , U : ' static + AsExecutionPlan > TaskManager < T , U > {
82
67
pub fn new (
83
68
state : Arc < dyn StateBackendClient > ,
@@ -92,7 +77,7 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> TaskManager<T, U>
92
77
codec,
93
78
scheduler_id,
94
79
active_job_cache : Arc :: new ( RwLock :: new ( HashMap :: new ( ) ) ) ,
95
- pending_task_queue_size : AtomicUsize :: new ( 0 ) ,
80
+ pending_task_queue_size : Arc :: new ( AtomicUsize :: new ( 0 ) ) ,
96
81
}
97
82
}
98
83
0 commit comments