pub struct ReplicationManager { /* private fields */ }Implementations§
Source§impl ReplicationManager
impl ReplicationManager
pub fn new( nodes: Arc<Mutex<HashMap<String, Arc<Node>>>>, replication_factor: usize, node_id: String, ) -> Self
Sourcepub fn set_storage(&mut self, storage: Arc<Mutex<Storage>>)
pub fn set_storage(&mut self, storage: Arc<Mutex<Storage>>)
Set the storage for persistent replication
Sourcepub fn set_transport(&mut self, transport: Arc<NetworkTransport>)
pub fn set_transport(&mut self, transport: Arc<NetworkTransport>)
Set the network transport for distributed replication
pub async fn send_data_update( &self, partition_id: String, data: Vec<u8>, ) -> Result<(), String>
pub async fn send_state_update( &self, partition_id: String, status: ReplicationStatus, ) -> Result<(), String>
pub async fn notify_node_failure(&self, node_id: String) -> Result<(), String>
pub fn start(&mut self)
Sourcepub async fn handle_replication_request(
&self,
message: DistributedMessage,
) -> NetworkResult<Option<DistributedMessage>>
pub async fn handle_replication_request( &self, message: DistributedMessage, ) -> NetworkResult<Option<DistributedMessage>>
Handle replication request from remote node
Sourcepub async fn handle_replication_response(
&self,
message: DistributedMessage,
) -> NetworkResult<()>
pub async fn handle_replication_response( &self, message: DistributedMessage, ) -> NetworkResult<()>
Handle replication response from remote node
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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