Package io.microraft

Enum RaftNodeStatus

java.lang.Object
java.lang.Enum<RaftNodeStatus>
io.microraft.RaftNodeStatus
All Implemented Interfaces:
Serializable, Comparable<RaftNodeStatus>, java.lang.constant.Constable

public enum RaftNodeStatus extends Enum<RaftNodeStatus>
Statuses of a Raft node during its own and its Raft group's lifecycle.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    A Raft node stays in this status when there is no ongoing membership change or a Raft group termination process.
    Initial status of a Raft node.
    A Raft node moves to this status either when it is removed from the Raft group member list, or it is being terminated on its own, for instance, because its JVM is shutting down.
    A Raft node moves to this status when a Raft group membership change operation is appended to its Raft log and stays in this status until the membership change is either committed or reverted.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Returns true if the given Raft node status is a terminal.
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • INITIAL

      public static final RaftNodeStatus INITIAL
      Initial status of a Raft node. It stays in this status until it is started.
    • ACTIVE

      public static final RaftNodeStatus ACTIVE
      A Raft node stays in this status when there is no ongoing membership change or a Raft group termination process. Operations are committed in this status.
    • UPDATING_RAFT_GROUP_MEMBER_LIST

      public static final RaftNodeStatus UPDATING_RAFT_GROUP_MEMBER_LIST
      A Raft node moves to this status when a Raft group membership change operation is appended to its Raft log and stays in this status until the membership change is either committed or reverted. New operations can be replicated while there is an ongoing membership change in the Raft group, but no other membership change, or leadership transfer can be triggered until the ongoing membership change process is completed.
    • TERMINATED

      public static final RaftNodeStatus TERMINATED
      A Raft node moves to this status either when it is removed from the Raft group member list, or it is being terminated on its own, for instance, because its JVM is shutting down.

      A Raft node stops running the Raft consensus algorithm in this status.

  • Method Details

    • values

      public static RaftNodeStatus[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static RaftNodeStatus valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • isTerminal

      public static boolean isTerminal(RaftNodeStatus status)
      Returns true if the given Raft node status is a terminal. A Raft node stops running the Raft consensus algorithm in a terminal status.
      Parameters:
      status - the status object to check
      Returns:
      true if the given status is terminal, false otherwise