public interface PrimaryElection extends ListenerService<PrimaryElectionEvent,PrimaryElectionEventListener>
A primary election is used to elect a primary and backups for a single partition. To enter a primary election
for a partition, a node must call the enter(GroupMember) method. Once an election is complete, the
PrimaryTerm can be read via getTerm().
The prioritization of candidates within a primary election is unspecified.
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<PrimaryTerm> |
enter(GroupMember member)
Enters the primary election.
|
CompletableFuture<PrimaryTerm> |
getTerm()
Returns the current term.
|
addListener, removeListenerCompletableFuture<PrimaryTerm> enter(GroupMember member)
When entering a primary election, the provided GroupMember will be added to the election's candidate list.
The returned term is representative of the term after the member joins the election. Thus, if the
joining member is immediately elected primary, the returned term should reflect that.
member - the member to enter the electionCompletableFuture<PrimaryTerm> getTerm()
The term is representative of the current primary, candidates, and backups in the primary election.
Copyright © 2013–2018. All rights reserved.