Skip to content

Commit 5ad27c0

Browse files
Add public methods to SchedulerServer
1 parent c615fce commit 5ad27c0

File tree

1 file changed

+11
-7
lines changed
  • ballista/scheduler/src/scheduler_server

1 file changed

+11
-7
lines changed

ballista/scheduler/src/scheduler_server/mod.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH};
2020

2121
use ballista_core::error::Result;
2222
use ballista_core::event_loop::{EventLoop, EventSender};
23-
use ballista_core::serde::protobuf::{StopExecutorParams, TaskStatus};
23+
use ballista_core::serde::protobuf::{JobStatus, StopExecutorParams, TaskStatus};
2424
use ballista_core::serde::{AsExecutionPlan, BallistaCodec};
2525
use ballista_core::utils::default_session_builder;
2626

@@ -171,15 +171,11 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> SchedulerServer<T
171171
Ok(())
172172
}
173173

174-
pub(crate) fn pending_tasks(&self) -> usize {
174+
pub fn pending_tasks(&self) -> usize {
175175
self.query_stage_scheduler.pending_tasks()
176176
}
177177

178-
pub(crate) fn metrics_collector(&self) -> &dyn SchedulerMetricsCollector {
179-
self.query_stage_scheduler.metrics_collector()
180-
}
181-
182-
pub(crate) async fn submit_job(
178+
pub async fn submit_job(
183179
&self,
184180
job_id: &str,
185181
job_name: &str,
@@ -198,6 +194,14 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> SchedulerServer<T
198194
.await
199195
}
200196

197+
pub async fn get_active_job_status(&self, job_id: &str) -> Result<Option<JobStatus>> {
198+
self.state.task_manager.get_job_status(job_id).await
199+
}
200+
201+
pub(crate) fn metrics_collector(&self) -> &dyn SchedulerMetricsCollector {
202+
self.query_stage_scheduler.metrics_collector()
203+
}
204+
201205
/// It just send task status update event to the channel,
202206
/// and will not guarantee the event processing completed after return
203207
pub(crate) async fn update_task_status(

0 commit comments

Comments
 (0)