Class ClusterAllocationExplanation

java.lang.Object
org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplanation
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject

public final class ClusterAllocationExplanation
extends java.lang.Object
implements org.elasticsearch.common.xcontent.ToXContentObject, Writeable
A ClusterAllocationExplanation is an explanation of why a shard is unassigned, or if it is not unassigned, then which nodes it could possibly be relocated to. It is an immutable class.
  • Constructor Details

  • 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
      Throws:
      java.io.IOException
    • getShard

      public ShardId getShard()
      Returns the shard that the explanation is about.
    • isPrimary

      public boolean isPrimary()
      Returns true if the explained shard is primary, false otherwise.
    • getShardState

      public ShardRoutingState getShardState()
      Returns the current ShardRoutingState of the shard.
    • getCurrentNode

      @Nullable public DiscoveryNode getCurrentNode()
      Returns the currently assigned node, or null if the shard is unassigned.
    • getRelocationTargetNode

      @Nullable public DiscoveryNode getRelocationTargetNode()
      Returns the relocating target node, or null if the shard is not in the ShardRoutingState.RELOCATING state.
    • getUnassignedInfo

      @Nullable public UnassignedInfo getUnassignedInfo()
      Returns the unassigned info for the shard, or null if the shard is active.
    • getClusterInfo

      @Nullable public ClusterInfo getClusterInfo()
      Returns the cluster disk info for the cluster, or null if none available.
    • getShardAllocationDecision

      public ShardAllocationDecision getShardAllocationDecision()
      Returns the shard allocation decision for attempting to assign or move the shard.
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException