pub struct ExecutorManager { /* private fields */ }Implementations§
Source§impl ExecutorManager
impl ExecutorManager
pub async fn init(&self) -> Result<()>
Sourcepub async fn bind_schedulable_tasks(
&self,
active_jobs: Arc<HashMap<String, JobInfoCache>>,
) -> Result<Vec<BoundTask>>
pub async fn bind_schedulable_tasks( &self, active_jobs: Arc<HashMap<String, JobInfoCache>>, ) -> Result<Vec<BoundTask>>
Bind the ready to running tasks from [active_jobs] with available executors.
If executors is provided, only bind slots from the specified executor IDs
Sourcepub async fn unbind_tasks(
&self,
executor_slots: Vec<ExecutorSlot>,
) -> Result<()>
pub async fn unbind_tasks( &self, executor_slots: Vec<ExecutorSlot>, ) -> Result<()>
Returned reserved task slots to the pool of available slots. This operation is atomic so either the entire pool of reserved task slots it returned or none are.
Sourcepub async fn cancel_running_tasks(
&self,
tasks: Vec<RunningTaskInfo>,
) -> Result<()>
pub async fn cancel_running_tasks( &self, tasks: Vec<RunningTaskInfo>, ) -> Result<()>
Send rpc to Executors to cancel the running tasks
Sourcepub fn clean_up_job_data(&self, job_id: String)
pub fn clean_up_job_data(&self, job_id: String)
Send rpc to Executors to clean up the job data in a spawn thread
Sourcepub async fn get_executor_state(
&self,
) -> Result<Vec<(ExecutorMetadata, Duration)>>
pub async fn get_executor_state( &self, ) -> Result<Vec<(ExecutorMetadata, Duration)>>
Get a list of all executors along with the timestamp of their last recorded heartbeat
Sourcepub async fn get_executor_metadata(
&self,
executor_id: &str,
) -> Result<ExecutorMetadata>
pub async fn get_executor_metadata( &self, executor_id: &str, ) -> Result<ExecutorMetadata>
Get executor metadata for the provided executor ID. Returns an error if the executor does not exist
Sourcepub async fn save_executor_metadata(
&self,
metadata: ExecutorMetadata,
) -> Result<()>
pub async fn save_executor_metadata( &self, metadata: ExecutorMetadata, ) -> Result<()>
It’s only used for pull-based task scheduling.
For push-based one, we should use [register_executor], instead.
Sourcepub async fn register_executor(
&self,
metadata: ExecutorMetadata,
specification: ExecutorData,
) -> Result<()>
pub async fn register_executor( &self, metadata: ExecutorMetadata, specification: ExecutorData, ) -> Result<()>
Register the executor with the scheduler.
This will save the executor metadata and the executor data to persistent state.
It’s only used for push-based task scheduling
Sourcepub async fn remove_executor(
&self,
executor_id: &str,
reason: Option<String>,
) -> Result<()>
pub async fn remove_executor( &self, executor_id: &str, reason: Option<String>, ) -> Result<()>
Remove the executor from the cluster
pub async fn stop_executor(&self, executor_id: &str, stop_reason: String)
pub async fn launch_multi_task( &self, executor_id: &str, multi_tasks: Vec<MultiTaskDefinition>, scheduler_id: String, ) -> Result<()>
Trait Implementations§
Source§impl Clone for ExecutorManager
impl Clone for ExecutorManager
Source§fn clone(&self) -> ExecutorManager
fn clone(&self) -> ExecutorManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ExecutorManager
impl !RefUnwindSafe for ExecutorManager
impl Send for ExecutorManager
impl Sync for ExecutorManager
impl Unpin for ExecutorManager
impl !UnwindSafe for ExecutorManager
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