Struct raft::ProgressTracker[][src]

pub struct ProgressTracker { /* fields omitted */ }
Expand description

ProgressTracker contains several Progresses, which could be Leader, Follower and Learner.

Implementations

The current configuration state of the cluster.

Creates a new ProgressTracker.

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 reference to the progress of a node.

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.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.