Enum Class Cluster.Role

java.lang.Object
java.lang.Enum<Cluster.Role>
io.aeron.cluster.service.Cluster.Role
All Implemented Interfaces:
Serializable, Comparable<Cluster.Role>, Constable
Enclosing interface:
Cluster

public static enum Cluster.Role extends Enum<Cluster.Role>
Role of the node in the cluster.
  • Enum Constant Details

    • FOLLOWER

      public static final Cluster.Role FOLLOWER
      The cluster node is a follower in the current leadership term.
    • CANDIDATE

      public static final Cluster.Role CANDIDATE
      The cluster node is a candidate to become a leader in an election.
    • LEADER

      public static final Cluster.Role LEADER
      The cluster node is the leader for the current leadership term.
  • Method Details

    • values

      public static Cluster.Role[] 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

      public static Cluster.Role valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • code

      public final int code()
      The code which matches the role in the cluster.
      Returns:
      the code which matches the role in the cluster.
    • get

      public static Cluster.Role get(long code)
      Get the role from a code read from a counter.
      Parameters:
      code - for the Cluster.Role.
      Returns:
      the Cluster.Role of the cluster node.
    • get

      public static Cluster.Role get(AtomicCounter counter)
      Get the role by reading the code from a counter.
      Parameters:
      counter - containing the value of the role.
      Returns:
      the role for the cluster member.