Class ClusterAllocationExplainRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.action.support.master.MasterNodeRequest<ClusterAllocationExplainRequest>
-
- org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainRequest
-
- All Implemented Interfaces:
Streamable,Writeable,TaskAwareRequest
public class ClusterAllocationExplainRequest extends MasterNodeRequest<ClusterAllocationExplainRequest>
A request to explain the allocation of a shard in the cluster
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
-
-
Constructor Summary
Constructors Constructor Description ClusterAllocationExplainRequest()Create a new allocation explain request to explain any unassigned shard in the cluster.
-
Method Summary
Modifier and Type Method Description java.lang.StringgetCurrentNode()Returns the node holding the replica shard to be explained.java.lang.StringgetIndex()Returns the index name of the shard to explain, ornullto use any unassigned shard (seeuseAnyUnassignedShard()).java.lang.IntegergetShard()Returns the shard id of the shard to explain, ornullto use any unassigned shard (seeuseAnyUnassignedShard()).booleanincludeDiskInfo()Returnstrueif information about disk usage and shard sizes should also be returned.voidincludeDiskInfo(boolean includeDiskInfo)Set totrueto include information about the gathered disk information of nodes in the cluster.booleanincludeYesDecisions()Returnstrueif yes decisions should be included.voidincludeYesDecisions(boolean includeYesDecisions)Set totrueto include yes decisions for a particular node.java.lang.BooleanisPrimary()Returnstrueif explaining the primary shard for the shard id (seegetShard()),falseif explaining a replica shard copy for the shard id, ornullto use any unassigned shard (seeuseAnyUnassignedShard()).static ClusterAllocationExplainRequestparse(XContentParser parser)voidreadFrom(StreamInput in)Set this object's fields from a StreamInput.ClusterAllocationExplainRequestsetCurrentNode(java.lang.String currentNodeId)Requests the explain API to explain an already assigned replica shard currently allocated to the given node.ClusterAllocationExplainRequestsetIndex(java.lang.String index)Sets the index name of the shard to explain.ClusterAllocationExplainRequestsetPrimary(java.lang.Boolean primary)Sets whether to explain the allocation of the primary shard or a replica shard copy for the shard id (seegetShard()).ClusterAllocationExplainRequestsetShard(java.lang.Integer shard)Sets the shard id of the shard to explain.java.lang.StringtoString()booleanuseAnyUnassignedShard()Returnstrueiff the first unassigned shard is to be usedActionRequestValidationExceptionvalidate()voidwriteTo(StreamOutput out)Write this object's fields to a StreamOutput.-
Methods inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
-
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
-
-
-
Method Detail
-
validate
public ActionRequestValidationException validate()
- Specified by:
validatein classActionRequest
-
useAnyUnassignedShard
public boolean useAnyUnassignedShard()
Returnstrueiff the first unassigned shard is to be used
-
setIndex
public ClusterAllocationExplainRequest setIndex(java.lang.String index)
Sets the index name of the shard to explain.
-
getIndex
@Nullable public java.lang.String getIndex()
Returns the index name of the shard to explain, ornullto use any unassigned shard (seeuseAnyUnassignedShard()).
-
setShard
public ClusterAllocationExplainRequest setShard(java.lang.Integer shard)
Sets the shard id of the shard to explain.
-
getShard
@Nullable public java.lang.Integer getShard()
Returns the shard id of the shard to explain, ornullto use any unassigned shard (seeuseAnyUnassignedShard()).
-
setPrimary
public ClusterAllocationExplainRequest setPrimary(java.lang.Boolean primary)
Sets whether to explain the allocation of the primary shard or a replica shard copy for the shard id (seegetShard()).
-
isPrimary
@Nullable public java.lang.Boolean isPrimary()
Returnstrueif explaining the primary shard for the shard id (seegetShard()),falseif explaining a replica shard copy for the shard id, ornullto use any unassigned shard (seeuseAnyUnassignedShard()).
-
setCurrentNode
public ClusterAllocationExplainRequest setCurrentNode(java.lang.String currentNodeId)
Requests the explain API to explain an already assigned replica shard currently allocated to the given node.
-
getCurrentNode
@Nullable public java.lang.String getCurrentNode()
Returns the node holding the replica shard to be explained. Returnsnullif any replica shard can be explained.
-
includeYesDecisions
public void includeYesDecisions(boolean includeYesDecisions)
Set totrueto include yes decisions for a particular node.
-
includeYesDecisions
public boolean includeYesDecisions()
Returnstrueif yes decisions should be included. Otherwise only "no" and "throttle" decisions are returned.
-
includeDiskInfo
public void includeDiskInfo(boolean includeDiskInfo)
Set totrueto include information about the gathered disk information of nodes in the cluster.
-
includeDiskInfo
public boolean includeDiskInfo()
Returnstrueif information about disk usage and shard sizes should also be returned.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
parse
public static ClusterAllocationExplainRequest parse(XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:StreamableSet this object's fields from a StreamInput.- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classMasterNodeRequest<ClusterAllocationExplainRequest>- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:StreamableWrite this object's fields to a StreamOutput.- Specified by:
writeToin interfaceStreamable- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classMasterNodeRequest<ClusterAllocationExplainRequest>- Throws:
java.io.IOException
-
-