Enum Class ShardRouting.Role

java.lang.Object
java.lang.Enum<ShardRouting.Role>
org.elasticsearch.cluster.routing.ShardRouting.Role
All Implemented Interfaces:
Serializable, Comparable<ShardRouting.Role>, Constable, Writeable, ToXContent, ToXContentFragment
Enclosing class:
ShardRouting

public static enum ShardRouting.Role extends Enum<ShardRouting.Role> implements Writeable, ToXContentFragment
  • Enum Constant Details

  • Method Details

    • values

      public static ShardRouting.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 ShardRouting.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
    • isPromotableToPrimary

      public boolean isPromotableToPrimary()
      Returns:
      whether a shard copy with this role may be promoted from replica to primary. If index.number_of_replicas is reduced, unpromotable replicas are removed first.
    • isSearchable

      public boolean isSearchable()
      Returns:
      whether a shard copy with this role may be the target of a search.
    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • readFrom

      public static ShardRouting.Role readFrom(StreamInput in) throws IOException
      Throws:
      IOException