pub struct TopicPartitionInfo { /* private fields */ }Expand description
A class containing leadership, replicas and ISR information for a topic partition.
Implementations§
Source§impl TopicPartitionInfo
impl TopicPartitionInfo
Sourcepub fn with_elr_last_known_elr(
partition: i32,
leader: Option<Node>,
replicas: Vec<Node>,
isr: Vec<Node>,
elr: Vec<Node>,
last_known_elr: Vec<Node>,
) -> Self
pub fn with_elr_last_known_elr( partition: i32, leader: Option<Node>, replicas: Vec<Node>, isr: Vec<Node>, elr: Vec<Node>, last_known_elr: Vec<Node>, ) -> Self
Create an instance with the provided parameters.
§Arguments
partition- the partition idleader- the leader of the partition orNoneif there is none.replicas- the replicas of the partition in the same order as the replica assignment (the preferred replica is the head of the list)isr- the in-sync replicaselr- the eligible leader replicaslast_known_elr- the last known eligible leader replicas.
Sourcepub fn new(
partition: i32,
leader: Option<Node>,
replicas: Vec<Node>,
isr: Vec<Node>,
) -> Self
pub fn new( partition: i32, leader: Option<Node>, replicas: Vec<Node>, isr: Vec<Node>, ) -> Self
Create an instance with the provided parameters, without eligible leader replica information.
§Arguments
partition- the partition idleader- the leader of the partition orNoneif there is none.replicas- the replicas of the partition in the same order as the replica assignment (the preferred replica is the head of the list)isr- the in-sync replicas
Sourcepub fn leader(&self) -> Option<&Node>
pub fn leader(&self) -> Option<&Node>
Returns the leader of the partition or None if there is none.
Sourcepub fn replicas(&self) -> &[Node]
pub fn replicas(&self) -> &[Node]
Returns the replicas of the partition in the same order as the replica assignment. The preferred replica is the head of the list.
Brokers with version lower than 0.11.0.0 return the replicas in unspecified order due to a bug.
Sourcepub fn isr(&self) -> &[Node]
pub fn isr(&self) -> &[Node]
Returns the in-sync replicas of the partition. The ordering is unspecified.
Sourcepub fn elr(&self) -> Option<&[Node]>
pub fn elr(&self) -> Option<&[Node]>
Returns the eligible leader replicas of the partition, or None if
unavailable. The ordering is unspecified.
Sourcepub fn last_known_elr(&self) -> Option<&[Node]>
pub fn last_known_elr(&self) -> Option<&[Node]>
Returns the last known eligible leader replicas of the partition, or
None if unavailable. The ordering is unspecified.
Trait Implementations§
Source§impl Clone for TopicPartitionInfo
impl Clone for TopicPartitionInfo
Source§fn clone(&self) -> TopicPartitionInfo
fn clone(&self) -> TopicPartitionInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TopicPartitionInfo
impl Debug for TopicPartitionInfo
Source§impl Display for TopicPartitionInfo
impl Display for TopicPartitionInfo
Source§impl Hash for TopicPartitionInfo
impl Hash for TopicPartitionInfo
Source§impl PartialEq for TopicPartitionInfo
impl PartialEq for TopicPartitionInfo
impl Eq for TopicPartitionInfo
impl StructuralPartialEq for TopicPartitionInfo
Auto Trait Implementations§
impl Freeze for TopicPartitionInfo
impl RefUnwindSafe for TopicPartitionInfo
impl Send for TopicPartitionInfo
impl Sync for TopicPartitionInfo
impl Unpin for TopicPartitionInfo
impl UnsafeUnpin for TopicPartitionInfo
impl UnwindSafe for TopicPartitionInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.