pub struct RangeSplit { /* private fields */ }Expand description
The two entries a split_range produces: the child the owner keeps and the
child the move will hand off.
Applying a split is order-sensitive — the retained child must be narrowed
first, then the moved child created — or the create would transiently
overlap the still-full original and the catalog would reject it.
apply does this in the right order.
Implementations§
Source§impl RangeSplit
impl RangeSplit
Sourcepub fn retained(&self) -> &RangeOwnership
pub fn retained(&self) -> &RangeOwnership
The child the owner keeps writing — the original range id, narrowed to the non-moved keys, version advanced but epoch unchanged (no authority moved).
Sourcepub fn moved(&self) -> &RangeOwnership
pub fn moved(&self) -> &RangeOwnership
The carved-off child the move hands off — a fresh range id, still owned by the original owner (which keeps serving its keys until cutover) with the move target enlisted as a replica.
Sourcepub fn apply(
&self,
catalog: &mut ShardOwnershipCatalog,
) -> Result<(), CatalogError>
pub fn apply( &self, catalog: &mut ShardOwnershipCatalog, ) -> Result<(), CatalogError>
Install the split into the catalog: narrow the retained child first, then
create the moved child. After this the two children tile the original
keyspace and the move can proceed on moved’s range id.
Trait Implementations§
Source§impl Clone for RangeSplit
impl Clone for RangeSplit
Source§fn clone(&self) -> RangeSplit
fn clone(&self) -> RangeSplit
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 RangeSplit
impl Debug for RangeSplit
impl Eq for RangeSplit
Source§impl PartialEq for RangeSplit
impl PartialEq for RangeSplit
Source§fn eq(&self, other: &RangeSplit) -> bool
fn eq(&self, other: &RangeSplit) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RangeSplit
Auto Trait Implementations§
impl Freeze for RangeSplit
impl RefUnwindSafe for RangeSplit
impl Send for RangeSplit
impl Sync for RangeSplit
impl Unpin for RangeSplit
impl UnsafeUnpin for RangeSplit
impl UnwindSafe for RangeSplit
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