pub struct TransitionRequest { /* private fields */ }Expand description
A request to move ownership of one range. Carries the three-part CAS
(expected owner / epoch / catalog version), the target candidate, the range
commit watermark the candidate must cover, and the candidate’s catch-up
evidence. Built with TransitionRequest::new; the replica set the new owner
will carry defaults to empty and is set with
with_replicas.
Implementations§
Source§impl TransitionRequest
impl TransitionRequest
Sourcepub fn new(
kind: TransitionKind,
collection: CollectionId,
range_id: RangeId,
expected_owner: NodeIdentity,
expected_epoch: OwnershipEpoch,
expected_version: CatalogVersion,
target: NodeIdentity,
watermark: CommitWatermark,
) -> TransitionRequest
pub fn new( kind: TransitionKind, collection: CollectionId, range_id: RangeId, expected_owner: NodeIdentity, expected_epoch: OwnershipEpoch, expected_version: CatalogVersion, target: NodeIdentity, watermark: CommitWatermark, ) -> TransitionRequest
A transition request with no safety evidence yet and an empty post-cutover
replica set. Evidence must be attached with
with_evidence before the transition can be
admitted — a request without it fails closed
(MissingSafetyEvidence).
Sourcepub fn with_evidence(self, evidence: CatchUpEvidence) -> TransitionRequest
pub fn with_evidence(self, evidence: CatchUpEvidence) -> TransitionRequest
Attach the candidate’s catch-up evidence for the safety gate.
Sourcepub fn with_replicas(
self,
replicas: impl IntoIterator<Item = NodeIdentity>,
) -> TransitionRequest
pub fn with_replicas( self, replicas: impl IntoIterator<Item = NodeIdentity>, ) -> TransitionRequest
Set the replica set the new owner will carry after cutover. Defaults to empty. A handoff that demotes the old owner to a replica passes it here.
pub fn kind(&self) -> TransitionKind
pub fn collection(&self) -> &CollectionId
pub fn range_id(&self) -> RangeId
pub fn target(&self) -> &NodeIdentity
Trait Implementations§
Source§impl Clone for TransitionRequest
impl Clone for TransitionRequest
Source§fn clone(&self) -> TransitionRequest
fn clone(&self) -> TransitionRequest
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 TransitionRequest
impl Debug for TransitionRequest
impl Eq for TransitionRequest
Source§impl PartialEq for TransitionRequest
impl PartialEq for TransitionRequest
Source§fn eq(&self, other: &TransitionRequest) -> bool
fn eq(&self, other: &TransitionRequest) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TransitionRequest
Auto Trait Implementations§
impl Freeze for TransitionRequest
impl RefUnwindSafe for TransitionRequest
impl Send for TransitionRequest
impl Sync for TransitionRequest
impl Unpin for TransitionRequest
impl UnsafeUnpin for TransitionRequest
impl UnwindSafe for TransitionRequest
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 moreSource§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>
T in a tonic::Request