Module org.elasticsearch.server
Enum Class 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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
static ShardRouting.Role
readFrom
(StreamInput in) toXContent
(XContentBuilder builder, ToXContent.Params params) static ShardRouting.Role
Returns the enum constant of this class with the specified name.static ShardRouting.Role[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Enum Constant Details
-
DEFAULT
-
INDEX_ONLY
-
SEARCH_ONLY
-
-
Method Details
-
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
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 nameNullPointerException
- 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 interfaceToXContent
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
readFrom
- Throws:
IOException
-