public interface ElectionTerm
This information includes the last known current term of the RaftActor and which candidate was voted for by the RaftActor in that term.
This class ensures that election term information is persisted.
Modifier and Type | Method and Description |
---|---|
long |
getCurrentTerm()
Returns the current leader's Raft term.
|
String |
getVotedFor()
Returns the id of the candidate that this server voted for in current term.
|
void |
update(long term,
String votedFor)
This method updates the in-memory election term state.
|
void |
updateAndPersist(long term,
String votedFor)
This method updates the in-memory election term state and persists it so it can be recovered on next restart.
|
long getCurrentTerm()
@Nullable String getVotedFor()
void update(long term, @Nullable String votedFor)
term
- the election term.votedFor
- the candidate id that was voted for.void updateAndPersist(long term, @Nullable String votedFor)
term
- the election term.votedFor
- the candidate id that was voted for.Copyright © 2019 OpenDaylight. All rights reserved.