pub struct ReplicationManager { /* private fields */ }Expand description
Manager for data replication across cluster nodes Implements Write-Ahead Log pattern and Leader-Follower replication [AIR-3][AIS-3][RES-3][SCL-3]
Implementations§
Source§impl ReplicationManager
impl ReplicationManager
Sourcepub fn new(config: &HighAvailabilityConfig) -> Self
pub fn new(config: &HighAvailabilityConfig) -> Self
Creates a new replication manager
Sourcepub async fn initialize(&mut self) -> Result<(), HaError>
pub async fn initialize(&mut self) -> Result<(), HaError>
Initializes the replication manager
Sourcepub async fn start_replication(&mut self) -> Result<(), HaError>
pub async fn start_replication(&mut self) -> Result<(), HaError>
Starts replication services
Sourcepub async fn stop_replication(&mut self) -> Result<(), HaError>
pub async fn stop_replication(&mut self) -> Result<(), HaError>
Stops replication services
Sourcepub async fn replicate_write(
&self,
operation: WriteOperation,
) -> Result<ReplicationResult, HaError>
pub async fn replicate_write( &self, operation: WriteOperation, ) -> Result<ReplicationResult, HaError>
Replicates a write operation
Sourcepub async fn promote_to_leader(&mut self) -> Result<(), HaError>
pub async fn promote_to_leader(&mut self) -> Result<(), HaError>
Handles leader promotion for this node
Sourcepub async fn demote_from_leader(&mut self) -> Result<(), HaError>
pub async fn demote_from_leader(&mut self) -> Result<(), HaError>
Handles demotion from leader role
Sourcepub async fn get_replication_status(&self) -> Result<ReplicationState, HaError>
pub async fn get_replication_status(&self) -> Result<ReplicationState, HaError>
Gets current replication status
Sourcepub async fn update_config(
&mut self,
config: &HighAvailabilityConfig,
) -> Result<(), HaError>
pub async fn update_config( &mut self, config: &HighAvailabilityConfig, ) -> Result<(), HaError>
Updates configuration
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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