Class ShardAllocationDecision

org.elasticsearch.cluster.routing.allocation.ShardAllocationDecision
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public final class ShardAllocationDecision extends implements org.elasticsearch.common.xcontent.ToXContentFragment, Writeable
Represents the decision taken for the allocation of a single shard. If the shard is unassigned, getAllocateDecision() will return an object containing the decision and its explanation, and getMoveDecision() will return an object for which MoveDecision.isDecisionTaken() returns false. If the shard is in the started state, then getMoveDecision() will return an object containing the decision to move/rebalance the shard, and getAllocateDecision() will return an object for which AllocateUnassignedDecision.isDecisionTaken() returns false. If the shard is neither unassigned nor started (i.e. it is initializing or relocating), then both getAllocateDecision() and getMoveDecision() will return objects whose isDecisionTaken() method returns false.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the unassigned allocation decision for the shard.
    Gets the move decision for the shard.
    boolean
    Returns true if either an allocation decision or a move decision was taken for the shard.
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    void
    Write this into the StreamOutput.

    Methods inherited from class java.lang.

    , , , , , , , , , ,

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Field Details

  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
    • isDecisionTaken

      public boolean isDecisionTaken()
      Returns true if either an allocation decision or a move decision was taken for the shard. If no decision was taken, as in the case of initializing or relocating shards, then this method returns false.
    • getAllocateDecision

      public AllocateUnassignedDecision getAllocateDecision()
      Gets the unassigned allocation decision for the shard. If the shard was not in the unassigned state, the instance of AllocateUnassignedDecision that is returned will have AllocateUnassignedDecision.isDecisionTaken() return false.
    • getMoveDecision

      public MoveDecision getMoveDecision()
      Gets the move decision for the shard. If the shard was not in the started state, the instance of MoveDecision that is returned will have MoveDecision.isDecisionTaken() return false.
    • toXContent

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