Class PlacementConstraint.TargetConstraint
java.lang.Object
org.apache.hadoop.yarn.api.resource.PlacementConstraint.AbstractConstraint
org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint
- All Implemented Interfaces:
PlacementConstraint.Visitable
- Enclosing class:
- PlacementConstraint
public static class PlacementConstraint.TargetConstraint
extends PlacementConstraint.AbstractConstraint
Class that represents a target constraint. Such a constraint requires an
allocation to be placed within a scope that satisfies some specified
expressions on node attributes and allocation tags.
It is a specialized version of the
PlacementConstraint.SingleConstraint, where the
minimum and the maximum cardinalities take specific values based on the
PlacementConstraint.TargetConstraint.TargetOperator used.-
Constructor Summary
ConstructorsConstructorDescriptionTargetConstraint(org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint.TargetOperator op, String scope, Set<PlacementConstraint.TargetExpression> targetExpressions) -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(PlacementConstraint.Visitor<T> visitor) Visitor pattern.booleanorg.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint.TargetOperatorgetOp()Get the target operator of the constraint.getScope()Get the scope of the constraint.Get the set of target expressions.inthashCode()toString()Methods inherited from class org.apache.hadoop.yarn.api.resource.PlacementConstraint.AbstractConstraint
build
-
Constructor Details
-
TargetConstraint
public TargetConstraint(org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint.TargetOperator op, String scope, Set<PlacementConstraint.TargetExpression> targetExpressions)
-
-
Method Details
-
getOp
public org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint.TargetOperator getOp()Get the target operator of the constraint.- Returns:
- the target operator
-
getScope
Get the scope of the constraint.- Returns:
- the scope of the constraint
-
getTargetExpressions
Get the set of target expressions.- Returns:
- the set of target expressions
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toStringin classPlacementConstraint.AbstractConstraint
-
accept
Description copied from interface:PlacementConstraint.VisitableVisitor pattern.- 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.
-