pub struct RebalancePlan {
pub moves: Vec<PlannedMove>,
pub replica_replacements: Vec<PlannedReplicaReplacement>,
pub hotspots: Vec<HotspotRange>,
pub warnings: Vec<PlacementWarning>,
}Expand description
The planner’s decision for one pass: the moves to schedule and the hotspots it observed.
A cluster already balanced by capacity, with no hotspot, yields an empty plan
(is_empty) — the no-op a stable cluster must produce.
Fields§
§moves: Vec<PlannedMove>Proposed moves, in a deterministic order (capacity moves first, then
hotspot-relief moves, each in (collection, range_id) order).
replica_replacements: Vec<PlannedReplicaReplacement>Proposed replica-list changes that restore failure-domain spread without changing the range owner.
hotspots: Vec<HotspotRange>Ranges observed to be hotspots this pass, hottest first.
warnings: Vec<PlacementWarning>Loud operator warnings for placement rules the topology cannot satisfy.
Implementations§
Source§impl RebalancePlan
impl RebalancePlan
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Nothing to schedule and nothing hot — a fully balanced, evenly-loaded
cluster. Distinct from no_moves: a balanced cluster can
still have an observed hotspot it cannot relieve.
Sourcepub fn no_moves(&self) -> bool
pub fn no_moves(&self) -> bool
Whether the plan proposes any actual range movement. False on a cluster that is balanced by capacity and has no relievable hotspot, even if a hotspot was observed.
Sourcepub fn capacity_moves(&self) -> impl Iterator<Item = &PlannedMove>
pub fn capacity_moves(&self) -> impl Iterator<Item = &PlannedMove>
The capacity-balance moves only (the primary signal).
Sourcepub fn hotspot_moves(&self) -> impl Iterator<Item = &PlannedMove>
pub fn hotspot_moves(&self) -> impl Iterator<Item = &PlannedMove>
The hotspot-relief moves only (the secondary signal).
Trait Implementations§
Source§impl Clone for RebalancePlan
impl Clone for RebalancePlan
Source§fn clone(&self) -> RebalancePlan
fn clone(&self) -> RebalancePlan
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 RebalancePlan
impl Debug for RebalancePlan
Source§impl Default for RebalancePlan
impl Default for RebalancePlan
Source§fn default() -> RebalancePlan
fn default() -> RebalancePlan
impl Eq for RebalancePlan
Source§impl PartialEq for RebalancePlan
impl PartialEq for RebalancePlan
impl StructuralPartialEq for RebalancePlan
Auto Trait Implementations§
impl Freeze for RebalancePlan
impl RefUnwindSafe for RebalancePlan
impl Send for RebalancePlan
impl Sync for RebalancePlan
impl Unpin for RebalancePlan
impl UnsafeUnpin for RebalancePlan
impl UnwindSafe for RebalancePlan
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