pub struct RangePartitioner { /* private fields */ }Expand description
Range-based node partitioner for ordered node IDs
Implementations§
Source§impl RangePartitioner
impl RangePartitioner
Sourcepub fn new(shard_count: u32) -> Self
pub fn new(shard_count: u32) -> Self
Create a new range partitioner with automatic range distribution
Sourcepub fn with_boundaries(boundaries: Vec<String>) -> Self
pub fn with_boundaries(boundaries: Vec<String>) -> Self
Create a range partitioner with explicit boundaries
Sourcepub fn get_shard(&self, node_id: &NodeId) -> ShardId
pub fn get_shard(&self, node_id: &NodeId) -> ShardId
Get the shard ID for a node based on range boundaries
Sourcepub fn update_boundaries(&mut self, new_boundaries: Vec<String>)
pub fn update_boundaries(&mut self, new_boundaries: Vec<String>)
Update range boundaries based on data distribution
Auto Trait Implementations§
impl Freeze for RangePartitioner
impl RefUnwindSafe for RangePartitioner
impl Send for RangePartitioner
impl Sync for RangePartitioner
impl Unpin for RangePartitioner
impl UnwindSafe for RangePartitioner
Blanket Implementations§
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> 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