Class ClusterRerouteRequest

All Implemented Interfaces:
AckedRequest, Writeable, RefCounted, TaskAwareRequest

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

  • 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
      writeTo in class AcknowledgedRequest<ClusterRerouteRequest>
    • equals

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

      public int hashCode()
      hashCode in class Object