Struct raft::ProgressTracker [−][src]
pub struct ProgressTracker { /* fields omitted */ }
Expand description
ProgressTracker
contains several Progress
es,
which could be Leader
, Follower
and Learner
.
Implementations
Create a progress set with the specified sizes already reserved.
Configures group commit.
Whether enable group commit.
Returns true if (and only if) there is only one voting member (i.e. the leader) in the current configuration.
Grabs a mutable reference to the progress of a node.
Returns an iterator across all the nodes and their progress.
Note: Do not use this for majority/quorum calculation. The Raft node may be
transitioning to a new configuration and have two qourums. Use has_quorum
instead.
Returns a mutable iterator across all the nodes and their progress.
Note: Do not use this for majority/quorum calculation. The Raft node may be
transitioning to a new configuration and have two qourums. Use has_quorum
instead.
Returns the maximal committed index for the cluster. The bool flag indicates whether the index is computed by group commit algorithm successfully.
Eg. If the matched indexes are [2,2,2,4,5]
, it will return 2
.
If the matched indexes and groups are [(1, 1), (2, 2), (3, 2)]
, it will return 1
.
Prepares for a new round of vote counting via recordVote.
Records that the node with the given id voted for this Raft instance if v == true (and declined it otherwise).
TallyVotes returns the number of granted and rejected Votes, and whether the election outcome is known.
pub fn vote_result(
&self,
votes: &HashMap<u64, bool, BuildHasherDefault<FxHasher>>
) -> VoteResult
[src]
pub fn vote_result(
&self,
votes: &HashMap<u64, bool, BuildHasherDefault<FxHasher>>
) -> VoteResult
[src]Returns the Candidate’s eligibility in the current election.
If it is still eligible, it should continue polling nodes and checking.
Eventually, the election will result in this returning either Elected
or Ineligible
, meaning the election can be concluded.
Determines if the current quorum is active according to the this raft node.
Doing this will set the recent_active
of each peer to false.
This should only be called by the leader.
pub fn has_quorum(
&self,
potential_quorum: &HashSet<u64, BuildHasherDefault<FxHasher>>
) -> bool
[src]
pub fn has_quorum(
&self,
potential_quorum: &HashSet<u64, BuildHasherDefault<FxHasher>>
) -> bool
[src]Determine if a quorum is formed from the given set of nodes.
This is the only correct way to verify you have reached a quorum for the whole group.
Applies configuration and updates progress map to match the configuration.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ProgressTracker
impl Send for ProgressTracker
impl Sync for ProgressTracker
impl Unpin for ProgressTracker
impl UnwindSafe for ProgressTracker
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V