Class ClusterRerouteRequest

All Implemented Interfaces:
AckedRequest, Writeable, org.elasticsearch.core.RefCounted, TaskAwareRequest

public class ClusterRerouteRequest extends AcknowledgedRequest<ClusterRerouteRequest>
Request to submit cluster reroute allocation commands
  • Constructor Details

    • ClusterRerouteRequest

      public ClusterRerouteRequest(StreamInput in) throws IOException
      Throws:
      IOException
    • ClusterRerouteRequest

      public ClusterRerouteRequest()
  • Method Details

    • 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 to false) 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 to false). 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

      Specified by:
      validate in class ActionRequest
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class AcknowledgedRequest<ClusterRerouteRequest>
      Throws:
      IOException
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object