Enum ReplicaState

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ReplicaState>

    public enum ReplicaState
    extends java.lang.Enum<ReplicaState>
    The states of ambry replica that are managed by Helix controller. Ambry router makes decision based on these states when routing requests.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOOTSTRAP
      Bootstrap state is an intermediate state between OFFLINE and STANDBY.
      DROPPED
      End state of a replica that is decommissioned.
      ERROR
      When replica behaves unexpectedly and Helix makes replica in this state.
      INACTIVE
      Inactive is an intermediate state between OFFLINE and STANDBY.
      LEADER
      The state in which replica is fully functioning.
      OFFLINE
      Initial state of replica when starting up.
      STANDBY
      The state in which replica is fully functioning.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ReplicaState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ReplicaState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

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

      • OFFLINE

        public static final ReplicaState OFFLINE
        Initial state of replica when starting up. Router should not send any request to replica in this state.
      • BOOTSTRAP

        public static final ReplicaState BOOTSTRAP
        Bootstrap state is an intermediate state between OFFLINE and STANDBY. This state allows replica to do some bootstrap work like checking replication lag and catching up with peers. GET, DELETE, TTLUpdate can be routed to replica in this state.
      • STANDBY

        public static final ReplicaState STANDBY
        The state in which replica is fully functioning. That is, it can receive all types of requests.
      • LEADER

        public static final ReplicaState LEADER
        The state in which replica is fully functioning. For replicas from same partition in same DC, at most one is in LEADER state. Currently we don't distinguish LEADER from STANDBY and they both can receive all types of requests. In the future, we may leverage LEADER replica to perform cross-dc replication.
      • INACTIVE

        public static final ReplicaState INACTIVE
        Inactive is an intermediate state between OFFLINE and STANDBY. This state allows replica to do some decommission work like making sure its peers have caught up with it. Only GET request is allowed to be routed to inactive replica.
      • ERROR

        public static final ReplicaState ERROR
        When replica behaves unexpectedly and Helix makes replica in this state.
      • DROPPED

        public static final ReplicaState DROPPED
        End state of a replica that is decommissioned.
    • Method Detail

      • values

        public static ReplicaState[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ReplicaState c : ReplicaState.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ReplicaState valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null