pub struct TaskManager<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> { /* private fields */ }Implementations§
Source§impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> TaskManager<T, U>
impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> TaskManager<T, U>
pub fn new( state: Arc<dyn JobState>, codec: KapotCodec<T, U>, scheduler_id: String, ) -> Self
Sourcepub fn queue_job(
&self,
job_id: &str,
job_name: &str,
queued_at: u64,
) -> Result<()>
pub fn queue_job( &self, job_id: &str, job_name: &str, queued_at: u64, ) -> Result<()>
Enqueue a job for scheduling
Sourcepub fn pending_job_number(&self) -> usize
pub fn pending_job_number(&self) -> usize
Get the number of queued jobs. If it’s big, then it means the scheduler is too busy. In normal case, it’s better to be 0.
Sourcepub fn running_job_number(&self) -> usize
pub fn running_job_number(&self) -> usize
Get the number of running jobs.
Sourcepub async fn submit_job(
&self,
job_id: &str,
job_name: &str,
session_id: &str,
plan: Arc<dyn ExecutionPlan>,
queued_at: u64,
) -> Result<()>
pub async fn submit_job( &self, job_id: &str, job_name: &str, session_id: &str, plan: Arc<dyn ExecutionPlan>, queued_at: u64, ) -> Result<()>
Generate an ExecutionGraph for the job and save it to the persistent state. By default, this job will be curated by the scheduler which receives it. Then we will also save it to the active execution graph
pub fn get_running_job_cache(&self) -> Arc<HashMap<String, JobInfoCache>>
Sourcepub async fn get_jobs(&self) -> Result<Vec<JobOverview>>
pub async fn get_jobs(&self) -> Result<Vec<JobOverview>>
Get a list of active job ids
Sourcepub async fn get_job_status(&self, job_id: &str) -> Result<Option<JobStatus>>
pub async fn get_job_status(&self, job_id: &str) -> Result<Option<JobStatus>>
Get the status of of a job. First look in the active cache. If no one found, then in the Active/Completed jobs, and then in Failed jobs
Sourcepub async fn fail_unscheduled_job(
&self,
job_id: &str,
failure_reason: String,
) -> Result<()>
pub async fn fail_unscheduled_job( &self, job_id: &str, failure_reason: String, ) -> Result<()>
Mark a unscheduled job as failed. This will create a key under the FailedJobs keyspace and remove the job from ActiveJobs or QueuedJobs
pub async fn update_job(&self, job_id: &str) -> Result<usize>
Sourcepub async fn executor_lost(
&self,
executor_id: &str,
) -> Result<Vec<RunningTaskInfo>>
pub async fn executor_lost( &self, executor_id: &str, ) -> Result<Vec<RunningTaskInfo>>
return a Vec of running tasks need to cancel
Sourcepub async fn get_available_task_count(&self, job_id: &str) -> Result<usize>
pub async fn get_available_task_count(&self, job_id: &str) -> Result<usize>
Retrieve the number of available tasks for the given job. The value returned is strictly a point-in-time snapshot
pub fn prepare_task_definition( &self, task: TaskDescription, ) -> Result<TaskDefinition>
Sourcepub fn generate_job_id(&self) -> String
pub fn generate_job_id(&self) -> String
Generate a new random Job ID
Trait Implementations§
Source§impl<T: Clone + 'static + AsLogicalPlan, U: Clone + 'static + AsExecutionPlan> Clone for TaskManager<T, U>
impl<T: Clone + 'static + AsLogicalPlan, U: Clone + 'static + AsExecutionPlan> Clone for TaskManager<T, U>
Source§fn clone(&self) -> TaskManager<T, U>
fn clone(&self) -> TaskManager<T, U>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T, U> Freeze for TaskManager<T, U>
impl<T, U> !RefUnwindSafe for TaskManager<T, U>
impl<T, U> Send for TaskManager<T, U>
impl<T, U> Sync for TaskManager<T, U>
impl<T, U> Unpin for TaskManager<T, U>
impl<T, U> !UnwindSafe for TaskManager<T, U>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request