From 954e5acd0952c2bfb17fbba116e5eb1623df7ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9E=97=E4=BC=9F?= Date: Tue, 27 Aug 2024 14:35:40 +0800 Subject: [PATCH] Cleanup code --- .../src/scheduler_server/query_stage_scheduler.rs | 7 ++++++- ballista/scheduler/src/state/task_manager.rs | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ballista/scheduler/src/scheduler_server/query_stage_scheduler.rs b/ballista/scheduler/src/scheduler_server/query_stage_scheduler.rs index d2e8e5b1..54d48dbd 100644 --- a/ballista/scheduler/src/scheduler_server/query_stage_scheduler.rs +++ b/ballista/scheduler/src/scheduler_server/query_stage_scheduler.rs @@ -171,7 +171,12 @@ impl EventAction for QueryStageScheduler { } QueryStageSchedulerEvent::JobCancel(job_id) => { info!("Job {} Cancelled", job_id); - match self.state.task_manager.cancel_job(&job_id).await { + match self + .state + .task_manager + .abort_job(&job_id, "Cancelled".to_owned()) + .await + { Ok((running_tasks, _pending_tasks)) => { event_sender .post_event(QueryStageSchedulerEvent::CancelTasks(running_tasks)) diff --git a/ballista/scheduler/src/state/task_manager.rs b/ballista/scheduler/src/state/task_manager.rs index 4f2c95f7..662e2318 100644 --- a/ballista/scheduler/src/state/task_manager.rs +++ b/ballista/scheduler/src/state/task_manager.rs @@ -316,11 +316,6 @@ impl TaskManager { Ok(()) } - /// Cancel the job and return a Vec of running tasks need to cancel - pub(crate) async fn cancel_job(&self, job_id: &str) -> Result<(Vec, usize)> { - self.abort_job(job_id, "Cancelled".to_owned()).await - } - /// Abort the job and return a Vec of running tasks need to cancel pub(crate) async fn abort_job( &self,