Package org.opendaylight.raft.api
Enum Class RaftRole
- All Implemented Interfaces:
Serializable
,Comparable<RaftRole>
,Constable
The role a server is performing in terms of its contributing towards maintaining the RAFT journal. This is a
finer-grained view on RAFT than what
ServerRole
provices. Note that the unusual naming here is intentional to
differentiate the two.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA candidate server.A follower server.A leader server which cannot communicate with its peers.A leader server.The winner of a RAFT election. -
Method Summary
Modifier and TypeMethodDescriptionReturns the correspondingServerRole
.static RaftRole
Returns the enum constant of this class with the specified name.static RaftRole[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Candidate
A candidate server. -
Follower
A follower server. -
Leader
A leader server. -
IsolatedLeader
A leader server which cannot communicate with its peers. -
PreLeader
The winner of a RAFT election. It is acting as aLeader
, but is not known to have a persisted its authority about its ownership of the term. This uncertainty is resolved once an entry for this term is applied to the log.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
serverRole
Returns the correspondingServerRole
.- Returns:
- the corresponding
ServerRole
-