pub struct ReplicationManager { /* private fields */ }Expand description
Replication manager.
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 with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default configuration.
Sourcepub fn create_replicas(
&self,
data_id: String,
size_bytes: u64,
available_workers: &[WorkerId],
) -> Result<ReplicaSet>
pub fn create_replicas( &self, data_id: String, size_bytes: u64, available_workers: &[WorkerId], ) -> Result<ReplicaSet>
Create replica set for data.
Sourcepub fn get_replicas(&self, data_id: &str) -> Option<ReplicaSet>
pub fn get_replicas(&self, data_id: &str) -> Option<ReplicaSet>
Get replica set for data.
Sourcepub fn update_worker_health(&self, health: WorkerHealth)
pub fn update_worker_health(&self, health: WorkerHealth)
Update worker health.
Sourcepub fn mark_replica_failed(
&self,
data_id: &str,
worker_id: WorkerId,
) -> Result<()>
pub fn mark_replica_failed( &self, data_id: &str, worker_id: WorkerId, ) -> Result<()>
Mark replica as failed.
Sourcepub fn check_rereplication(
&self,
available_workers: &[WorkerId],
) -> Vec<(String, WorkerId)>
pub fn check_rereplication( &self, available_workers: &[WorkerId], ) -> Vec<(String, WorkerId)>
Check and perform re-replication if needed.
Sourcepub fn add_replica(&self, data_id: &str, worker_id: WorkerId) -> Result<()>
pub fn add_replica(&self, data_id: &str, worker_id: WorkerId) -> Result<()>
Add replica to existing set.
Sourcepub fn get_statistics(&self) -> ReplicationStatistics
pub fn get_statistics(&self) -> ReplicationStatistics
Get statistics.
Trait Implementations§
Source§impl Clone for ReplicationManager
impl Clone for ReplicationManager
Source§fn clone(&self) -> ReplicationManager
fn clone(&self) -> ReplicationManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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