Class ClusterAllocationExplainRequest

All Implemented Interfaces:
Writeable, org.elasticsearch.common.util.concurrent.RefCounted, TaskAwareRequest

public class ClusterAllocationExplainRequest
extends MasterNodeRequest<ClusterAllocationExplainRequest>
A request to explain the allocation of a shard in the cluster
  • Constructor Details

    • ClusterAllocationExplainRequest

      public ClusterAllocationExplainRequest()
      Create a new allocation explain request to explain any unassigned shard in the cluster.
    • ClusterAllocationExplainRequest

      public ClusterAllocationExplainRequest​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
  • Method Details

    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class MasterNodeRequest<ClusterAllocationExplainRequest>
      Throws:
      java.io.IOException
    • validate

      Specified by:
      validate in class ActionRequest
    • useAnyUnassignedShard

      public boolean useAnyUnassignedShard()
      Returns true iff the first unassigned shard is to be used
    • setIndex

      public ClusterAllocationExplainRequest setIndex​(java.lang.String index)
      Sets the index name of the shard to explain.
    • getIndex

      @Nullable public java.lang.String getIndex()
      Returns the index name of the shard to explain, or null to use any unassigned shard (see useAnyUnassignedShard()).
    • setShard

      public ClusterAllocationExplainRequest setShard​(java.lang.Integer shard)
      Sets the shard id of the shard to explain.
    • getShard

      @Nullable public java.lang.Integer getShard()
      Returns the shard id of the shard to explain, or null to use any unassigned shard (see useAnyUnassignedShard()).
    • setPrimary

      public ClusterAllocationExplainRequest setPrimary​(java.lang.Boolean primary)
      Sets whether to explain the allocation of the primary shard or a replica shard copy for the shard id (see getShard()).
    • isPrimary

      @Nullable public java.lang.Boolean isPrimary()
      Returns true if explaining the primary shard for the shard id (see getShard()), false if explaining a replica shard copy for the shard id, or null to use any unassigned shard (see useAnyUnassignedShard()).
    • setCurrentNode

      public ClusterAllocationExplainRequest setCurrentNode​(java.lang.String currentNodeId)
      Requests the explain API to explain an already assigned replica shard currently allocated to the given node.
    • getCurrentNode

      @Nullable public java.lang.String getCurrentNode()
      Returns the node holding the replica shard to be explained. Returns null if any replica shard can be explained.
    • includeYesDecisions

      public void includeYesDecisions​(boolean includeYesDecisions)
      Set to true to include yes decisions for a particular node.
    • includeYesDecisions

      public boolean includeYesDecisions()
      Returns true if yes decisions should be included. Otherwise only "no" and "throttle" decisions are returned.
    • includeDiskInfo

      public void includeDiskInfo​(boolean includeDiskInfo)
      Set to true to include information about the gathered disk information of nodes in the cluster.
    • includeDiskInfo

      public boolean includeDiskInfo()
      Returns true if information about disk usage and shard sizes should also be returned.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • parse

      public static ClusterAllocationExplainRequest parse​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException