Module org.elasticsearch.server
Class ClusterAllocationExplainRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.LegacyActionRequest
org.elasticsearch.action.support.master.MasterNodeRequest<ClusterAllocationExplainRequest>
org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainRequest
- All Implemented Interfaces:
Writeable,RefCounted,TaskAwareRequest,TransportRequest
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 interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
INFINITE_MASTER_NODE_TIMEOUT, TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUTFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsConstructorDescriptionClusterAllocationExplainRequest(TimeValue masterNodeTimeout) Create a new allocation explain request to explain any unassigned shard in the cluster. -
Method Summary
Modifier and TypeMethodDescriptionReturns the node holding the replica shard to be explained.getIndex()Returns the index name of the shard to explain, ornullto use any unassigned shard (seeuseAnyUnassignedShard()).getShard()Returns the shard id of the shard to explain, ornullto use any unassigned shard (seeuseAnyUnassignedShard()).booleanReturnstrueif 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.booleanReturnstrueif yes decisions should be included.voidincludeYesDecisions(boolean includeYesDecisions) Set totrueto include yes decisions for a particular node.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()).parse(ClusterAllocationExplainRequest request, XContentParser parser) setCurrentNode(String currentNodeId) Requests the explain API to explain an already assigned replica shard currently allocated to the given node.Sets the index name of the shard to explain.setPrimary(Boolean primary) Sets whether to explain the allocation of the primary shard or a replica shard copy for the shard id (seegetShard()).Sets the shard id of the shard to explain.toString()booleanReturnstrueiff the first unassigned shard is to be usedvalidate()voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterTermMethods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestIdMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, createTask, getDescription, setParentTask
-
Field Details
-
INDEX_PARAMETER_NAME
- See Also:
-
SHARD_PARAMETER_NAME
- See Also:
-
PRIMARY_PARAMETER_NAME
- See Also:
-
CURRENT_NODE_PARAMETER_NAME
- See Also:
-
INCLUDE_YES_DECISIONS_PARAMETER_NAME
- See Also:
-
INCLUDE_DISK_INFO_PARAMETER_NAME
- See Also:
-
-
Constructor Details
-
ClusterAllocationExplainRequest
Create a new allocation explain request to explain any unassigned shard in the cluster. -
ClusterAllocationExplainRequest
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classMasterNodeRequest<ClusterAllocationExplainRequest>- Throws:
IOException
-
validate
- Specified by:
validatein classActionRequest
-
useAnyUnassignedShard
public boolean useAnyUnassignedShard()Returnstrueiff the first unassigned shard is to be used -
setIndex
Sets the index name of the shard to explain. -
getIndex
Returns the index name of the shard to explain, ornullto use any unassigned shard (seeuseAnyUnassignedShard()). -
setShard
Sets the shard id of the shard to explain. -
getShard
Returns the shard id of the shard to explain, ornullto use any unassigned shard (seeuseAnyUnassignedShard()). -
setPrimary
Sets whether to explain the allocation of the primary shard or a replica shard copy for the shard id (seegetShard()). -
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
Requests the explain API to explain an already assigned replica shard currently allocated to the given node. -
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
- Overrides:
toStringin classAbstractTransportRequest
-
parse
public static ClusterAllocationExplainRequest parse(ClusterAllocationExplainRequest request, XContentParser parser) throws IOException - Throws:
IOException
-