pub struct ReplicationManager { /* private fields */ }Expand description
Replication manager
Manages package replication across multiple nodes with configurable consistency levels, automatic failover, and conflict resolution.
Implementations§
Source§impl ReplicationManager
impl ReplicationManager
Sourcepub fn new(config: ReplicationConfig) -> Self
pub fn new(config: ReplicationConfig) -> Self
Create a new replication manager
Sourcepub fn add_node(&mut self, node: ReplicationNode) -> Result<(), TorshError>
pub fn add_node(&mut self, node: ReplicationNode) -> Result<(), TorshError>
Add a replication node
Sourcepub fn remove_node(&mut self, node_id: &str) -> Result<(), TorshError>
pub fn remove_node(&mut self, node_id: &str) -> Result<(), TorshError>
Remove a replication node
Sourcepub fn replicate_package(
&mut self,
package_id: &str,
version: &str,
_data: &[u8],
) -> Result<(), TorshError>
pub fn replicate_package( &mut self, package_id: &str, version: &str, _data: &[u8], ) -> Result<(), TorshError>
Replicate a package to all nodes
Sourcepub fn get_package(
&self,
package_id: &str,
version: &str,
) -> Result<String, TorshError>
pub fn get_package( &self, package_id: &str, version: &str, ) -> Result<String, TorshError>
Get package from best available replica
Sourcepub fn health_check(&mut self) -> Result<(), TorshError>
pub fn health_check(&mut self) -> Result<(), TorshError>
Perform health check on all nodes
Sourcepub fn synchronize(&mut self) -> Result<(), TorshError>
pub fn synchronize(&mut self) -> Result<(), TorshError>
Synchronize replicas across nodes
Sourcepub fn resolve_conflicts(&mut self) -> Result<(), TorshError>
pub fn resolve_conflicts(&mut self) -> Result<(), TorshError>
Detect and resolve conflicts
Sourcepub fn get_statistics(&self) -> &ReplicationStatistics
pub fn get_statistics(&self) -> &ReplicationStatistics
Get replication statistics
Sourcepub fn get_node_status(&self, node_id: &str) -> Option<NodeStatus>
pub fn get_node_status(&self, node_id: &str) -> Option<NodeStatus>
Get node status
Sourcepub fn list_nodes(&self) -> Vec<&ReplicationNode>
pub fn list_nodes(&self) -> Vec<&ReplicationNode>
List all nodes
Sourcepub fn list_replicas(
&self,
package_id: &str,
version: &str,
) -> Vec<&ReplicaMetadata>
pub fn list_replicas( &self, package_id: &str, version: &str, ) -> Vec<&ReplicaMetadata>
List replicas for a package
Sourcepub fn get_conflicts(&self) -> Vec<&ReplicationConflict>
pub fn get_conflicts(&self) -> Vec<&ReplicationConflict>
Get active conflicts
Auto Trait Implementations§
impl Freeze for ReplicationManager
impl RefUnwindSafe for ReplicationManager
impl Send for ReplicationManager
impl Sync for ReplicationManager
impl Unpin for ReplicationManager
impl UnsafeUnpin 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
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