public static enum Cluster.Role extends Enum<Cluster.Role>
Enum Constant and Description |
---|
CANDIDATE
The cluster node is a candidate to become a leader in an election.
|
FOLLOWER
The cluster node is a follower in the current leadership term.
|
LEADER
The cluster node is the leader for the current leadership term.
|
Modifier and Type | Method and Description |
---|---|
int |
code()
The code which matches the role in the cluster.
|
static Cluster.Role |
get(AtomicCounter counter)
Get the role by reading the code from a counter.
|
static Cluster.Role |
get(long code)
Get the role from a code read from a counter.
|
static Cluster.Role |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Cluster.Role[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Cluster.Role FOLLOWER
public static final Cluster.Role CANDIDATE
public static final Cluster.Role LEADER
public static Cluster.Role[] values()
for (Cluster.Role c : Cluster.Role.values()) System.out.println(c);
public static Cluster.Role valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic final int code()
public static Cluster.Role get(long code)
code
- for the Cluster.Role
.Cluster.Role
of the cluster node.public static Cluster.Role get(AtomicCounter counter)
counter
- containing the value of the role.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.