pub struct WeightedPlacementPlanner { /* private fields */ }Expand description
The weighted-placement, multi-signal rebalancer planner.
Holds only the PlacementPolicy; all live state is read through
PlacementSignals at plan time, so one planner instance serves the whole
cluster lifetime.
Implementations§
Source§impl WeightedPlacementPlanner
impl WeightedPlacementPlanner
Sourcepub fn new(policy: PlacementPolicy) -> WeightedPlacementPlanner
pub fn new(policy: PlacementPolicy) -> WeightedPlacementPlanner
A planner with the given policy.
pub fn policy(&self) -> &PlacementPolicy
Sourcepub fn plan_rebalance(
&self,
membership: &MembershipCatalog,
ownership: &ShardOwnershipCatalog,
signals: &impl PlacementSignals,
) -> RebalancePlan
pub fn plan_rebalance( &self, membership: &MembershipCatalog, ownership: &ShardOwnershipCatalog, signals: &impl PlacementSignals, ) -> RebalancePlan
Plan a rebalance across the whole ownership catalog without mutating
it. Runs the primary capacity-balance pass, then the secondary
hotspot-relief pass on top, and returns the combined RebalancePlan.
Ranges owned by members that are not placement-eligible (draining members,
witnesses) are left to the drain flow and never moved here.
pub fn plan_rebalance_scoped( &self, membership: &MembershipCatalog, ownership: &ShardOwnershipCatalog, signals: &impl PlacementSignals, authorities: &PlacementAuthorityCatalog, ) -> Result<AuthorityScopedRebalancePlan, PlacementAuthorityError>
Trait Implementations§
Source§impl Clone for WeightedPlacementPlanner
impl Clone for WeightedPlacementPlanner
Source§fn clone(&self) -> WeightedPlacementPlanner
fn clone(&self) -> WeightedPlacementPlanner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WeightedPlacementPlanner
impl Debug for WeightedPlacementPlanner
Source§impl Default for WeightedPlacementPlanner
impl Default for WeightedPlacementPlanner
Source§fn default() -> WeightedPlacementPlanner
fn default() -> WeightedPlacementPlanner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WeightedPlacementPlanner
impl RefUnwindSafe for WeightedPlacementPlanner
impl Send for WeightedPlacementPlanner
impl Sync for WeightedPlacementPlanner
impl Unpin for WeightedPlacementPlanner
impl UnsafeUnpin for WeightedPlacementPlanner
impl UnwindSafe for WeightedPlacementPlanner
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request