java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.Decision
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent
Direct Known Subclasses:
Decision.Multi, Decision.Single

public abstract class Decision extends Object implements org.elasticsearch.xcontent.ToXContent, Writeable
This abstract class defining basic Decision used during shard allocation process.
See Also:
  • Field Details

    • ALWAYS

      public static final Decision ALWAYS
    • YES

      public static final Decision YES
    • NO

      public static final Decision NO
    • THROTTLE

      public static final Decision THROTTLE
  • Constructor Details

    • Decision

      public Decision()
  • Method Details

    • single

      public static Decision single(Decision.Type type, @Nullable String label, @Nullable String explanation, @Nullable Object... explanationParams)
      Creates a simple decision
      Parameters:
      type - Decision.Type of the decision
      label - label for the Decider that produced this decision
      explanation - explanation of the decision
      explanationParams - additional parameters for the decision
      Returns:
      new Decision instance
    • readFrom

      public static Decision readFrom(StreamInput in) throws IOException
      Throws:
      IOException
    • type

      public abstract Decision.Type type()
      Get the Decision.Type of this decision
      Returns:
      Decision.Type of this decision
    • label

      @Nullable public abstract String label()
      Get the description label for this decision.
    • getExplanation

      @Nullable public abstract String getExplanation()
      Get the explanation for this decision.
    • getDecisions

      public abstract List<Decision> getDecisions()
      Return the list of all decisions that make up this decision