java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.Decision
org.elasticsearch.cluster.routing.allocation.decider.Decision.Single
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject
Enclosing class:
Decision

public static class Decision.Single extends Decision implements org.elasticsearch.common.xcontent.ToXContentObject
Simple class representing a single decision
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.elasticsearch.cluster.routing.allocation.decider.Decision

    Decision.Multi, Decision.Single, Decision.Type

    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 inherited from class org.elasticsearch.cluster.routing.allocation.decider.Decision

    ALWAYS, NO, THROTTLE, YES

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

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Single​(Decision.Type type, String label, String explanation, Object... explanationParams)
    Creates a new Decision.Single decision of a given type
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals​(Object object)
     
    Return the list of all decisions that make up this decision
    Returns the explanation string, fully formatted.
    int
     
    Get the description label for this decision.
     
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    Get the Decision.Type of this decision
    void
    Write this into the StreamOutput.

    Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.Decision

    readFrom, single

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

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

    isFragment
  • Constructor Details

    • Single

      public Single(Decision.Type type, @Nullable String label, @Nullable String explanation, @Nullable Object... explanationParams)
      Creates a new Decision.Single decision of a given type
      Parameters:
      type - Decision.Type of the decision
      explanation - An explanation of this Decision
      explanationParams - A set of additional parameters
  • Method Details

    • type

      public Decision.Type type()
      Description copied from class: Decision
      Get the Decision.Type of this decision
      Specified by:
      type in class Decision
      Returns:
      Decision.Type of this decision
    • label

      @Nullable public String label()
      Description copied from class: Decision
      Get the description label for this decision.
      Specified by:
      label in class Decision
    • getDecisions

      public List<Decision> getDecisions()
      Description copied from class: Decision
      Return the list of all decisions that make up this decision
      Specified by:
      getDecisions in class Decision
    • getExplanation

      @Nullable public String getExplanation()
      Returns the explanation string, fully formatted. Only formats the string once.
      Specified by:
      getExplanation in class Decision
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toXContent

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

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