Class PlacementConstraint.TargetExpression
java.lang.Object
org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetExpression
- All Implemented Interfaces:
PlacementConstraint.Visitable
- Enclosing class:
- PlacementConstraint
public static class PlacementConstraint.TargetExpression
extends Object
implements PlacementConstraint.Visitable
Class representing the target expressions that are used in placement
constraints. They might refer to expressions on node attributes, allocation
tags, or be self-targets (referring to the allocation to which the
constraint is attached).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum specifying the type of the target expression. -
Constructor Summary
ConstructorsConstructorDescriptionTargetExpression(PlacementConstraint.TargetExpression.TargetType targetType, String targetKey, String... targetValues) TargetExpression(PlacementConstraint.TargetExpression.TargetType targetType, String targetKey, Set<String> targetValues) -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(PlacementConstraint.Visitor<T> visitor) Visitor pattern.booleanGet the key of the target expression.Get the type of the target expression.Get the set of values of the target expression.inthashCode()toString()
-
Constructor Details
-
TargetExpression
public TargetExpression(PlacementConstraint.TargetExpression.TargetType targetType, String targetKey, Set<String> targetValues) -
TargetExpression
-
TargetExpression
public TargetExpression(PlacementConstraint.TargetExpression.TargetType targetType, String targetKey, String... targetValues)
-
-
Method Details
-
getTargetType
Get the type of the target expression.- Returns:
- the type of the target expression
-
getTargetKey
Get the key of the target expression.- Returns:
- the key of the target expression
-
getTargetValues
Get the set of values of the target expression.- Returns:
- the set of values of the target expression
-
hashCode
public int hashCode() -
equals
-
toString
-
accept
Description copied from interface:PlacementConstraint.VisitableVisitor pattern.- Specified by:
acceptin interfacePlacementConstraint.Visitable- Type Parameters:
T- defines the type that the visitor will use and the return type of the accept.- Parameters:
visitor- visitor to be used- Returns:
- the result of visiting a given object.
-