pub struct PartitionState { /* private fields */ }Expand description
Shared partition state. Written by the replicator actor on the control channel, read lock-free by PartitionHandle and StateReplicatorHandle.
copy_lsn_map stores per-replica copy boundary LSNs. Written by
run_build_replica_copy after snapshotting state, read by the actor
at UpdateCatchUpConfiguration to replay only ops beyond the copy
boundary (matching SF’s gap-free build approach).
Implementations§
Source§impl PartitionState
impl PartitionState
pub fn new() -> Self
pub fn read_status(&self) -> AccessStatus
pub fn write_status(&self) -> AccessStatus
pub fn current_progress(&self) -> Lsn
pub fn catch_up_capability(&self) -> Lsn
pub fn committed_lsn(&self) -> Lsn
pub fn set_read_status(&self, status: AccessStatus)
pub fn set_write_status(&self, status: AccessStatus)
pub fn set_current_progress(&self, lsn: Lsn)
pub fn set_catch_up_capability(&self, lsn: Lsn)
pub fn set_committed_lsn(&self, lsn: Lsn)
Sourcepub fn set_copy_lsn(&self, replica_id: ReplicaId, lsn: Lsn)
pub fn set_copy_lsn(&self, replica_id: ReplicaId, lsn: Lsn)
Record the copy snapshot LSN for a replica being built.
Called by run_build_replica_copy after collecting state.
Sourcepub fn take_copy_lsn(&self, replica_id: &ReplicaId) -> Option<Lsn>
pub fn take_copy_lsn(&self, replica_id: &ReplicaId) -> Option<Lsn>
Take (read and remove) the copy snapshot LSN for a replica. Called by the actor at UpdateCatchUpConfiguration to determine the precise replay boundary.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PartitionState
impl RefUnwindSafe for PartitionState
impl Send for PartitionState
impl Sync for PartitionState
impl Unpin for PartitionState
impl UnsafeUnpin for PartitionState
impl UnwindSafe for PartitionState
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request