pub struct MemberCapacity {
pub usable_disk_bytes: u64,
pub operator_weight: u32,
}Expand description
A member’s advertised placement capacity: how much usable disk it offers and the operator’s weight multiplier on top of it.
The two combine into the member’s weighted_capacity
— its share of the cluster it is meant to hold. Advertising more usable disk,
or a higher operator weight, raises that share; the planner then apportions
ranges toward it on the next plan. The struct is pure advertised state: it
records what a member offers, never moves anything by itself.
Fields§
§usable_disk_bytes: u64Usable disk the member advertises for user ranges, in bytes.
operator_weight: u32Operator weight in hundredths (NEUTRAL_OPERATOR_WEIGHT = 1.0×). Lets an
operator bias placement on or off a member without misreporting disk.
Implementations§
Source§impl MemberCapacity
impl MemberCapacity
Sourcepub fn new(usable_disk_bytes: u64, operator_weight: u32) -> MemberCapacity
pub fn new(usable_disk_bytes: u64, operator_weight: u32) -> MemberCapacity
Capacity with an explicit usable disk and operator weight.
Sourcepub fn with_disk(usable_disk_bytes: u64) -> MemberCapacity
pub fn with_disk(usable_disk_bytes: u64) -> MemberCapacity
Capacity from usable disk alone, at the neutral operator weight — the common case where the operator has expressed no preference.
Sourcepub fn weighted_capacity(&self) -> u128
pub fn weighted_capacity(&self) -> u128
The member’s placement weight: usable disk scaled by the operator
weight. This is the value the rebalancer apportions the cluster’s bytes by,
and it is exactly what expanding a member’s disk changes — a larger disk
(or a higher operator weight) yields a larger weighted capacity and so a
larger fair share on the next plan. Computed in u128 so a large disk
times a large weight cannot overflow.
Sourcepub fn is_placeable(&self) -> bool
pub fn is_placeable(&self) -> bool
Whether this member can hold any ranges at all — a member advertising no usable disk (or a zero operator weight) has zero weighted capacity and is never a placement target.
Trait Implementations§
Source§impl Clone for MemberCapacity
impl Clone for MemberCapacity
Source§fn clone(&self) -> MemberCapacity
fn clone(&self) -> MemberCapacity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MemberCapacity
Source§impl Debug for MemberCapacity
impl Debug for MemberCapacity
impl Eq for MemberCapacity
Source§impl PartialEq for MemberCapacity
impl PartialEq for MemberCapacity
Source§fn eq(&self, other: &MemberCapacity) -> bool
fn eq(&self, other: &MemberCapacity) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MemberCapacity
Auto Trait Implementations§
impl Freeze for MemberCapacity
impl RefUnwindSafe for MemberCapacity
impl Send for MemberCapacity
impl Sync for MemberCapacity
impl Unpin for MemberCapacity
impl UnsafeUnpin for MemberCapacity
impl UnwindSafe for MemberCapacity
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