Class ClusterRerouteRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.action.support.master.MasterNodeRequest<Request>
-
- org.elasticsearch.action.support.master.AcknowledgedRequest<ClusterRerouteRequest>
-
- org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteRequest
-
- All Implemented Interfaces:
AckedRequest,Writeable,TaskAwareRequest
public class ClusterRerouteRequest extends AcknowledgedRequest<ClusterRerouteRequest>
Request to submit cluster reroute allocation commands
-
-
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.AcknowledgedRequest
DEFAULT_ACK_TIMEOUT, timeout
-
Fields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
-
-
Constructor Summary
Constructors Constructor Description ClusterRerouteRequest()ClusterRerouteRequest(StreamInput in)
-
Method Summary
Modifier and Type Method Description ClusterRerouteRequestadd(AllocationCommand... commands)Adds allocation commands to be applied to the cluster.ClusterRerouteRequestcommands(AllocationCommands commands)Set the allocation commands to execute.booleandryRun()Returns the current dry run flag which allows to run the commands without actually applying them, just to get back the resulting cluster state back.ClusterRerouteRequestdryRun(boolean dryRun)Sets a dry run flag (defaults tofalse) allowing to run the commands without actually applying them to the cluster state, and getting the resulting cluster state back.booleanequals(java.lang.Object obj)booleanexplain()Returns the current explain flagClusterRerouteRequestexplain(boolean explain)Sets the explain flag, which will collect information about the reroute request without executing the actions.AllocationCommandsgetCommands()Returns the allocation commands to executeinthashCode()booleanisRetryFailed()Returns the current retry failed flagClusterRerouteRequestsetRetryFailed(boolean retryFailed)Sets the retry failed flag (defaults tofalse).ActionRequestValidationExceptionvalidate()voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class org.elasticsearch.action.support.master.AcknowledgedRequest
ackTimeout, timeout, timeout, timeout
-
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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.cluster.ack.AckedRequest
masterNodeTimeout
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
-
-
-
Constructor Detail
-
ClusterRerouteRequest
public ClusterRerouteRequest(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
ClusterRerouteRequest
public ClusterRerouteRequest()
-
-
Method Detail
-
add
public ClusterRerouteRequest add(AllocationCommand... commands)
Adds allocation commands to be applied to the cluster. Note, can be empty, in which case will simply run a simple "reroute".
-
dryRun
public ClusterRerouteRequest dryRun(boolean dryRun)
Sets a dry run flag (defaults tofalse) allowing to run the commands without actually applying them to the cluster state, and getting the resulting cluster state back.
-
dryRun
public boolean dryRun()
Returns the current dry run flag which allows to run the commands without actually applying them, just to get back the resulting cluster state back.
-
explain
public ClusterRerouteRequest explain(boolean explain)
Sets the explain flag, which will collect information about the reroute request without executing the actions. Similar to dryRun, but human-readable.
-
setRetryFailed
public ClusterRerouteRequest setRetryFailed(boolean retryFailed)
Sets the retry failed flag (defaults tofalse). If true, the request will retry allocating shards that can't currently be allocated due to too many allocation failures.
-
explain
public boolean explain()
Returns the current explain flag
-
isRetryFailed
public boolean isRetryFailed()
Returns the current retry failed flag
-
commands
public ClusterRerouteRequest commands(AllocationCommands commands)
Set the allocation commands to execute.
-
getCommands
public AllocationCommands getCommands()
Returns the allocation commands to execute
-
validate
public ActionRequestValidationException validate()
- Specified by:
validatein classActionRequest
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classAcknowledgedRequest<ClusterRerouteRequest>- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-