Module org.elasticsearch.server
Interface Decision
- All Superinterfaces:
ToXContent,Writeable
- All Known Implementing Classes:
Decision.Multi,Decision.Single
public sealed interface Decision
extends ToXContent, Writeable
permits Decision.Single, Decision.Multi
A
Decision used during shard allocation process.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordSimple class representing a list of decisionsstatic final recordSimple class representing a single decisionstatic enumThis enumeration defines the possible types of decisionsNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Decision.Singlestatic final Decision.Singlestatic final Decision.Singlestatic final Decision.Singlestatic final Decision.SingleFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Method Summary
Modifier and TypeMethodDescriptionReturn the list of all decisions that make up this decisionGet the explanation for this decision.label()Get the description label for this decision.static DecisionreadFrom(StreamInput in) static Decisionsingle(Decision.Type type, String label, String explanation, Object... explanationParams) Creates a newDecisioninstance including some (optional) extra details to explain it.type()Get theDecision.Typeof this decisionMethods inherited from interface org.elasticsearch.xcontent.ToXContent
isFragment, toXContent
-
Field Details
-
ALWAYS
-
YES
-
NOT_PREFERRED
-
NO
-
THROTTLE
-
-
Method Details
-
single
static Decision single(Decision.Type type, @Nullable String label, @Nullable String explanation, @Nullable Object... explanationParams) Creates a newDecisioninstance including some (optional) extra details to explain it. Do not call this method to create a newDecisioninstance in anAllocationDeciderimplementation unless the explanation is required, because allocation decision-making is a hot path and constructing fresh instances for each decision can be very expensive. Instead, checkRoutingAllocation.debugDecision()before doing nontrivial explanation work, and use one of the constants above such asYESorNOif no explanation is required. See alsoRoutingAllocation.decision(org.elasticsearch.cluster.routing.allocation.decider.Decision, java.lang.String, java.lang.String, java.lang.Object...)for a utility method to perform this check automatically.- Parameters:
type-Decision.Typeof the decisionlabel- label for the Decider that produced this decisionexplanation- explanation of the decisionexplanationParams- additional parameters for the decision- Returns:
- new
Decisioninstance
-
readFrom
- Throws:
IOException
-
type
Decision.Type type()Get theDecision.Typeof this decision- Returns:
Decision.Typeof this decision
-
label
Get the description label for this decision. -
getExplanation
Get the explanation for this decision. -
getDecisions
Return the list of all decisions that make up this decision
-