pub trait DistributedCluster: Send + Sync {
// Required methods
fn active_nodes(&self) -> BoxFuture<'_, Result<Vec<NodeId>>>;
fn coordinator(&self) -> &NodeId;
fn configuration(&self) -> &ClusterConfiguration;
fn add_node(&mut self, node: NodeId) -> BoxFuture<'_, Result<()>>;
fn remove_node(&mut self, node: NodeId) -> BoxFuture<'_, Result<()>>;
fn rebalance_load(&mut self) -> BoxFuture<'_, Result<()>>;
fn cluster_health(&self) -> BoxFuture<'_, Result<ClusterHealth>>;
fn create_checkpoint(&self) -> BoxFuture<'_, Result<ClusterCheckpoint>>;
fn restore_checkpoint(
&mut self,
checkpoint: ClusterCheckpoint,
) -> BoxFuture<'_, Result<()>>;
}Expand description
Distributed cluster management interface
Required Methods§
Sourcefn active_nodes(&self) -> BoxFuture<'_, Result<Vec<NodeId>>>
fn active_nodes(&self) -> BoxFuture<'_, Result<Vec<NodeId>>>
Get all active nodes in the cluster
Sourcefn coordinator(&self) -> &NodeId
fn coordinator(&self) -> &NodeId
Get the cluster coordinator node
Sourcefn configuration(&self) -> &ClusterConfiguration
fn configuration(&self) -> &ClusterConfiguration
Get cluster configuration
Sourcefn add_node(&mut self, node: NodeId) -> BoxFuture<'_, Result<()>>
fn add_node(&mut self, node: NodeId) -> BoxFuture<'_, Result<()>>
Add a new node to the cluster
Sourcefn remove_node(&mut self, node: NodeId) -> BoxFuture<'_, Result<()>>
fn remove_node(&mut self, node: NodeId) -> BoxFuture<'_, Result<()>>
Remove a node from the cluster
Sourcefn rebalance_load(&mut self) -> BoxFuture<'_, Result<()>>
fn rebalance_load(&mut self) -> BoxFuture<'_, Result<()>>
Redistribute work across cluster nodes
Sourcefn cluster_health(&self) -> BoxFuture<'_, Result<ClusterHealth>>
fn cluster_health(&self) -> BoxFuture<'_, Result<ClusterHealth>>
Get cluster health status
Sourcefn create_checkpoint(&self) -> BoxFuture<'_, Result<ClusterCheckpoint>>
fn create_checkpoint(&self) -> BoxFuture<'_, Result<ClusterCheckpoint>>
Create a checkpoint of cluster state
Sourcefn restore_checkpoint(
&mut self,
checkpoint: ClusterCheckpoint,
) -> BoxFuture<'_, Result<()>>
fn restore_checkpoint( &mut self, checkpoint: ClusterCheckpoint, ) -> BoxFuture<'_, Result<()>>
Restore from a checkpoint