Class ClusterAllocationExplainRequest

All Implemented Interfaces:
Writeable, org.elasticsearch.core.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 IOException
      Throws:
      IOException
  • Method Details

    • 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 MasterNodeRequest<ClusterAllocationExplainRequest>
      Throws:
      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(String index)
      Sets the index name of the shard to explain.
    • getIndex

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

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

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

      public ClusterAllocationExplainRequest setPrimary(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 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(String currentNodeId)
      Requests the explain API to explain an already assigned replica shard currently allocated to the given node.
    • getCurrentNode

      @Nullable public 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 String toString()
      Overrides:
      toString in class TransportRequest
    • parse

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