pub struct DistributedCluster { /* private fields */ }Expand description
Distributed computing cluster manager
Implementations§
Source§impl DistributedCluster
impl DistributedCluster
Sourcepub fn new(config: ClusterConfig) -> Self
pub fn new(config: ClusterConfig) -> Self
Create new distributed cluster
Sourcepub fn register_node(&self, node: ClusterNode) -> Result<(), DistributedError>
pub fn register_node(&self, node: ClusterNode) -> Result<(), DistributedError>
Register a node in the cluster
Sourcepub fn remove_node(&self, node_id: &str) -> Result<(), DistributedError>
pub fn remove_node(&self, node_id: &str) -> Result<(), DistributedError>
Remove a node from the cluster
Sourcepub fn get_nodes(&self) -> Vec<ClusterNode>
pub fn get_nodes(&self) -> Vec<ClusterNode>
Get all nodes in the cluster
Sourcepub fn get_available_nodes(&self) -> Vec<ClusterNode>
pub fn get_available_nodes(&self) -> Vec<ClusterNode>
Get available nodes
Sourcepub fn submit_job(
&self,
job: DistributedJob,
) -> Result<String, DistributedError>
pub fn submit_job( &self, job: DistributedJob, ) -> Result<String, DistributedError>
Submit a job to the cluster
Sourcepub fn schedule_jobs(&self) -> Result<(), DistributedError>
pub fn schedule_jobs(&self) -> Result<(), DistributedError>
Schedule jobs in the queue
Sourcepub fn get_job_status(&self, job_id: &str) -> Option<JobStatus>
pub fn get_job_status(&self, job_id: &str) -> Option<JobStatus>
Get job status
Sourcepub fn get_job_execution(&self, job_id: &str) -> Option<JobExecution>
pub fn get_job_execution(&self, job_id: &str) -> Option<JobExecution>
Get job execution info
Sourcepub fn cancel_job(&self, job_id: &str) -> Result<(), DistributedError>
pub fn cancel_job(&self, job_id: &str) -> Result<(), DistributedError>
Cancel a job
Sourcepub fn update_heartbeat(
&self,
node_id: &str,
load_metrics: LoadMetrics,
) -> Result<(), DistributedError>
pub fn update_heartbeat( &self, node_id: &str, load_metrics: LoadMetrics, ) -> Result<(), DistributedError>
Update node heartbeat
Sourcepub fn get_cluster_stats(&self) -> ClusterStats
pub fn get_cluster_stats(&self) -> ClusterStats
Get cluster statistics
Sourcepub fn start_monitoring(&self) -> Result<(), DistributedError>
pub fn start_monitoring(&self) -> Result<(), DistributedError>
Start cluster monitoring
Sourcepub fn rebalance_workload(&self) -> Result<(), DistributedError>
pub fn rebalance_workload(&self) -> Result<(), DistributedError>
Rebalance workload across nodes
Sourcepub fn handle_node_failure(&self, node_id: &str) -> Result<(), DistributedError>
pub fn handle_node_failure(&self, node_id: &str) -> Result<(), DistributedError>
Handle node failure
Auto Trait Implementations§
impl Freeze for DistributedCluster
impl RefUnwindSafe for DistributedCluster
impl Send for DistributedCluster
impl Sync for DistributedCluster
impl Unpin for DistributedCluster
impl UnwindSafe for DistributedCluster
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more