pub struct FaultToleranceManager { /* private fields */ }
Expand description
Fault tolerance manager
Implementations§
Source§impl FaultToleranceManager
impl FaultToleranceManager
Sourcepub fn failures(
detection_strategy: FaultDetectionStrategy,
maxfailures: usize,
) -> Self
pub fn failures( detection_strategy: FaultDetectionStrategy, maxfailures: usize, ) -> Self
Create a new fault tolerance manager
Sourcepub fn new(
detection_strategy: FaultDetectionStrategy,
maxfailures: usize,
) -> Self
pub fn new( detection_strategy: FaultDetectionStrategy, maxfailures: usize, ) -> Self
Create a new fault tolerance manager (alias for failures)
Sourcepub fn info(&mut self, nodeinfo: NodeInfo) -> CoreResult<()>
pub fn info(&mut self, nodeinfo: NodeInfo) -> CoreResult<()>
Register a node for monitoring
Sourcepub fn update_node_health(
&mut self,
nodeid: &str,
health: NodeHealth,
) -> CoreResult<()>
pub fn update_node_health( &mut self, nodeid: &str, health: NodeHealth, ) -> CoreResult<()>
Update node health status
Sourcepub fn get_healthy_nodes(&self) -> CoreResult<Vec<NodeInfo>>
pub fn get_healthy_nodes(&self) -> CoreResult<Vec<NodeInfo>>
Get all healthy nodes
Sourcepub fn get_failed_nodes(&self) -> CoreResult<Vec<NodeInfo>>
pub fn get_failed_nodes(&self) -> CoreResult<Vec<NodeInfo>>
Get all failed nodes
Sourcepub fn detect_failures(&self) -> CoreResult<Vec<String>>
pub fn detect_failures(&self) -> CoreResult<Vec<String>>
Detect failed nodes based on timeout
Sourcepub fn id_2(&self, nodeid: &str) -> CoreResult<()>
pub fn id_2(&self, nodeid: &str) -> CoreResult<()>
Initiate recovery for failed nodes
Sourcepub fn is_cluster_healthy(&self) -> CoreResult<bool>
pub fn is_cluster_healthy(&self) -> CoreResult<bool>
Check if the cluster has sufficient healthy nodes
Sourcepub fn get_cluster_health_summary(&self) -> CoreResult<ClusterHealthSummary>
pub fn get_cluster_health_summary(&self) -> CoreResult<ClusterHealthSummary>
Get cluster health summary
Sourcepub fn register_node(&self, node: NodeInfo) -> Result<(), FaultToleranceError>
pub fn register_node(&self, node: NodeInfo) -> Result<(), FaultToleranceError>
Register a node with the fault tolerance manager
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FaultToleranceManager
impl RefUnwindSafe for FaultToleranceManager
impl Send for FaultToleranceManager
impl Sync for FaultToleranceManager
impl Unpin for FaultToleranceManager
impl UnwindSafe for FaultToleranceManager
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