pub struct ClusterManager { /* private fields */ }
Expand description
Comprehensive cluster management system
Implementations§
Source§impl ClusterManager
impl ClusterManager
Sourcepub fn new(config: ClusterConfiguration) -> CoreResult<Self>
pub fn new(config: ClusterConfiguration) -> CoreResult<Self>
Create new cluster manager
Sourcepub fn global() -> CoreResult<Arc<Self>>
pub fn global() -> CoreResult<Arc<Self>>
Get global cluster manager instance
Sourcepub fn start(&self) -> CoreResult<()>
pub fn start(&self) -> CoreResult<()>
Start cluster management services
Sourcepub fn register_node(&self, nodeinfo: NodeInfo) -> CoreResult<()>
pub fn register_node(&self, nodeinfo: NodeInfo) -> CoreResult<()>
Register a new node in the cluster
Sourcepub fn get_health(&self) -> CoreResult<ClusterHealth>
pub fn get_health(&self) -> CoreResult<ClusterHealth>
Get cluster health status
Sourcepub fn get_active_nodes(&self) -> CoreResult<Vec<NodeInfo>>
pub fn get_active_nodes(&self) -> CoreResult<Vec<NodeInfo>>
Get list of active nodes
Sourcepub fn get_available_nodes(&self) -> CoreResult<HashMap<String, NodeInfo>>
pub fn get_available_nodes(&self) -> CoreResult<HashMap<String, NodeInfo>>
Get available nodes (returns nodeid -> nodeinfo mapping)
Sourcepub fn get_total_capacity(&self) -> CoreResult<ComputeCapacity>
pub fn get_total_capacity(&self) -> CoreResult<ComputeCapacity>
Get total cluster compute capacity
Sourcepub fn submit_task(&self, task: DistributedTask) -> CoreResult<TaskId>
pub fn submit_task(&self, task: DistributedTask) -> CoreResult<TaskId>
Submit a distributed task to the cluster
Sourcepub fn get_cluster_statistics(&self) -> CoreResult<ClusterStatistics>
pub fn get_cluster_statistics(&self) -> CoreResult<ClusterStatistics>
Get cluster statistics
Sourcepub fn stop(&self) -> CoreResult<()>
pub fn stop(&self) -> CoreResult<()>
Stop the cluster manager and all background threads
Sourcepub fn get_configuration(&self) -> CoreResult<ClusterConfiguration>
pub fn get_configuration(&self) -> CoreResult<ClusterConfiguration>
Get cluster configuration
Sourcepub fn update_configuration(
&self,
new_config: ClusterConfiguration,
) -> CoreResult<()>
pub fn update_configuration( &self, new_config: ClusterConfiguration, ) -> CoreResult<()>
Update cluster configuration
Sourcepub fn get_cluster_state(&self) -> CoreResult<String>
pub fn get_cluster_state(&self) -> CoreResult<String>
Get cluster state
Sourcepub fn force_leader_election(&self) -> CoreResult<Option<String>>
pub fn force_leader_election(&self) -> CoreResult<Option<String>>
Force leader election
Sourcepub fn remove_node(&self, node_id: &str) -> CoreResult<()>
pub fn remove_node(&self, node_id: &str) -> CoreResult<()>
Remove a node from the cluster
Sourcepub fn shutdown_node(&self, node_id: &str) -> CoreResult<()>
pub fn shutdown_node(&self, node_id: &str) -> CoreResult<()>
Gracefully shutdown a node
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClusterManager
impl RefUnwindSafe for ClusterManager
impl Send for ClusterManager
impl Sync for ClusterManager
impl Unpin for ClusterManager
impl UnwindSafe for ClusterManager
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