pub struct RepairProofs { /* private fields */ }Expand description
Evidence that this node has sent replica repair hints for local keys.
The map is keyed by record key so each key retains only one close-group snapshot and at most that snapshot’s peers. This bounds memory by local key count times the replication close-group size rather than by churn history.
Implementations§
Source§impl RepairProofs
impl RepairProofs
Sourcepub fn record_replica_hint_sent(
&mut self,
peer: PeerId,
key: XorName,
current_close_peers: &HashSet<PeerId>,
hinted_at_epoch: u64,
) -> bool
pub fn record_replica_hint_sent( &mut self, peer: PeerId, key: XorName, current_close_peers: &HashSet<PeerId>, hinted_at_epoch: u64, ) -> bool
Record that peer was sent a replica repair hint for key.
current_close_peers must be the current self-inclusive close group for
key. If that close group differs from the previous proof snapshot,
proofs for peers that left the close group are invalidated before
recording. Stable peers keep their proofs, while a peer that leaves and
later re-enters still needs a fresh hint.
Sourcepub fn has_mature_replica_hint(
&mut self,
peer: &PeerId,
key: &XorName,
current_close_peers: &HashSet<PeerId>,
current_epoch: u64,
) -> bool
pub fn has_mature_replica_hint( &mut self, peer: &PeerId, key: &XorName, current_close_peers: &HashSet<PeerId>, current_epoch: u64, ) -> bool
Whether this node has mature repair-hint evidence for (peer, key).
The check invalidates proofs for peers that have left the current self-inclusive close group. A proof is mature only after at least one later local sync-cycle epoch.
Sourcepub fn remove_key(&mut self, key: &XorName)
pub fn remove_key(&mut self, key: &XorName)
Remove all repair proofs for a key, e.g. after local deletion.
Sourcepub fn remove_peer(&mut self, peer: &PeerId)
pub fn remove_peer(&mut self, peer: &PeerId)
Remove all repair proofs for a peer, e.g. after routing-table removal.
Trait Implementations§
Source§impl Clone for RepairProofs
impl Clone for RepairProofs
Source§fn clone(&self) -> RepairProofs
fn clone(&self) -> RepairProofs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RepairProofs
impl Debug for RepairProofs
Source§impl Default for RepairProofs
impl Default for RepairProofs
Source§fn default() -> RepairProofs
fn default() -> RepairProofs
Auto Trait Implementations§
impl Freeze for RepairProofs
impl RefUnwindSafe for RepairProofs
impl Send for RepairProofs
impl Sync for RepairProofs
impl Unpin for RepairProofs
impl UnsafeUnpin for RepairProofs
impl UnwindSafe for RepairProofs
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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