pub struct ForcedTransitionRequest { /* private fields */ }Expand description
A request to force ownership of one range to target for disaster recovery.
Unlike a TransitionRequest
it carries no CAS expectations and no catch-up evidence — force exists precisely
for the case where those cannot be satisfied. What it carries instead are the
two authorisation inputs ADR 0037 requires: an optional
ForceTransitionCapability and an optional OperatorReason. They are
optional on the request so the authorisation gate can observe — and audit —
their absence; force_transition refuses any request missing either.
Implementations§
Source§impl ForcedTransitionRequest
impl ForcedTransitionRequest
Sourcepub fn new(
collection: CollectionId,
range_id: RangeId,
target: NodeIdentity,
) -> ForcedTransitionRequest
pub fn new( collection: CollectionId, range_id: RangeId, target: NodeIdentity, ) -> ForcedTransitionRequest
A forced-transition request for (collection, range_id) installing target
as the new owner, with no capability or reason attached yet. As built it
will be denied; attach authorisation with
with_capability and with_reason.
Sourcepub fn with_capability(
self,
capability: ForceTransitionCapability,
) -> ForcedTransitionRequest
pub fn with_capability( self, capability: ForceTransitionCapability, ) -> ForcedTransitionRequest
Attach the administrative capability authorising the force.
Sourcepub fn with_reason(self, reason: OperatorReason) -> ForcedTransitionRequest
pub fn with_reason(self, reason: OperatorReason) -> ForcedTransitionRequest
Attach the operator’s explicit justification.
Sourcepub fn with_replicas(
self,
replicas: impl IntoIterator<Item = NodeIdentity>,
) -> ForcedTransitionRequest
pub fn with_replicas( self, replicas: impl IntoIterator<Item = NodeIdentity>, ) -> ForcedTransitionRequest
Set the replica set the forced new owner will carry. Defaults to empty — in a disaster the operator often installs a sole survivor with no replicas.
pub fn collection(&self) -> &CollectionId
pub fn range_id(&self) -> RangeId
pub fn target(&self) -> &NodeIdentity
Trait Implementations§
Source§impl Clone for ForcedTransitionRequest
impl Clone for ForcedTransitionRequest
Source§fn clone(&self) -> ForcedTransitionRequest
fn clone(&self) -> ForcedTransitionRequest
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 ForcedTransitionRequest
impl Debug for ForcedTransitionRequest
impl Eq for ForcedTransitionRequest
Source§impl PartialEq for ForcedTransitionRequest
impl PartialEq for ForcedTransitionRequest
Source§fn eq(&self, other: &ForcedTransitionRequest) -> bool
fn eq(&self, other: &ForcedTransitionRequest) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ForcedTransitionRequest
Auto Trait Implementations§
impl Freeze for ForcedTransitionRequest
impl RefUnwindSafe for ForcedTransitionRequest
impl Send for ForcedTransitionRequest
impl Sync for ForcedTransitionRequest
impl Unpin for ForcedTransitionRequest
impl UnsafeUnpin for ForcedTransitionRequest
impl UnwindSafe for ForcedTransitionRequest
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