pub struct PartitionTable {
pub partition_count: u32,
/* private fields */
}Expand description
Partition assignment table
Fields§
§partition_count: u32Total number of partitions
Implementations§
Source§impl PartitionTable
impl PartitionTable
Sourcepub fn new(partition_count: u32, nodes: &[ClusterNode]) -> Self
pub fn new(partition_count: u32, nodes: &[ClusterNode]) -> Self
Create a new partition table and assign partitions to nodes.
Sourcepub fn partitions_for_node<'a>(&'a self, node_id: &str) -> Vec<&'a Partition>
pub fn partitions_for_node<'a>(&'a self, node_id: &str) -> Vec<&'a Partition>
Return all partitions owned by a given node.
Sourcepub fn rebalance(&mut self, nodes: &[ClusterNode])
pub fn rebalance(&mut self, nodes: &[ClusterNode])
Rebalance by rebuilding the ring after node changes.
Auto Trait Implementations§
impl Freeze for PartitionTable
impl RefUnwindSafe for PartitionTable
impl Send for PartitionTable
impl Sync for PartitionTable
impl Unpin for PartitionTable
impl UnsafeUnpin for PartitionTable
impl UnwindSafe for PartitionTable
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> 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