pub struct ReplicationManager { /* private fields */ }
Expand description
Replication manager for data redundancy
Implementations§
Source§impl ReplicationManager
impl ReplicationManager
Sourcepub fn new(cluster_state: Arc<ClusterState>, config: ReplicationConfig) -> Self
pub fn new(cluster_state: Arc<ClusterState>, config: ReplicationConfig) -> Self
Create a new replication manager
Sourcepub async fn start(&mut self) -> Result<(), ReplicationError>
pub async fn start(&mut self) -> Result<(), ReplicationError>
Start replication processes
Sourcepub async fn replicate_operation(
&self,
operation: Operation,
primary_node: &NodeId,
) -> Result<(), ReplicationError>
pub async fn replicate_operation( &self, operation: Operation, primary_node: &NodeId, ) -> Result<(), ReplicationError>
Queue an operation for replication
Sourcepub async fn sync_with_node(
&self,
node_id: &NodeId,
) -> Result<(), ReplicationError>
pub async fn sync_with_node( &self, node_id: &NodeId, ) -> Result<(), ReplicationError>
Synchronize data with a specific node
Sourcepub async fn handle_node_failure(
&self,
failed_node: &NodeId,
) -> Result<(), ReplicationError>
pub async fn handle_node_failure( &self, failed_node: &NodeId, ) -> Result<(), ReplicationError>
Handle node failure and promote replica
Sourcepub async fn check_health(&self) -> ReplicationHealth
pub async fn check_health(&self) -> ReplicationHealth
Check replication health
Sourcepub async fn get_status(&self) -> ReplicationStatusSnapshot
pub async fn get_status(&self) -> ReplicationStatusSnapshot
Get replication status
Sourcepub fn command_sender(&self) -> Sender<ReplicationCommand>
pub fn command_sender(&self) -> Sender<ReplicationCommand>
Get command sender for external commands
Auto Trait Implementations§
impl Freeze for ReplicationManager
impl !RefUnwindSafe for ReplicationManager
impl Send for ReplicationManager
impl Sync for ReplicationManager
impl Unpin for ReplicationManager
impl !UnwindSafe for ReplicationManager
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