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
,Streamable
,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()
-
Method Summary
Modifier and Type Method Description ClusterRerouteRequest
add(AllocationCommand... commands)
Adds allocation commands to be applied to the cluster.ClusterRerouteRequest
commands(AllocationCommands commands)
Set the allocation commands to execute.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.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.boolean
equals(java.lang.Object obj)
boolean
explain()
Returns the current explain flagClusterRerouteRequest
explain(boolean explain)
Sets the explain flag, which will collect information about the reroute request without executing the actions.AllocationCommands
getCommands()
Returns the allocation commands to executeint
hashCode()
boolean
isRetryFailed()
Returns the current retry failed flagvoid
readFrom(StreamInput in)
Set this object's fields from a StreamInput.ClusterRerouteRequest
setRetryFailed(boolean retryFailed)
Sets the retry failed flag (defaults tofalse
).ActionRequestValidationException
validate()
void
writeTo(StreamOutput out)
Write this object's fields to a 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
-
-
-
-
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:
validate
in classActionRequest
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classAcknowledgedRequest<ClusterRerouteRequest>
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classAcknowledgedRequest<ClusterRerouteRequest>
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-