@InterfaceAudience.Public @InterfaceStability.Unstable public final class PlacementConstraintParser extends Object
| Modifier and Type | Field and Description | 
|---|---|
static char | 
EXPRESSION_VAL_DELIM  | 
| Modifier and Type | Method and Description | 
|---|---|
static org.apache.hadoop.yarn.api.resource.PlacementConstraint.AbstractConstraint | 
parseExpression(String constraintStr)
Parses a given constraint expression to a  
PlacementConstraint.AbstractConstraint,
 this expression can be any valid form of constraint expressions. | 
static Map<org.apache.hadoop.yarn.util.constraint.PlacementConstraintParser.SourceTags,PlacementConstraint> | 
parsePlacementSpec(String expression)
Parses a placement constraint specification. 
 | 
public static final char EXPRESSION_VAL_DELIM
public static org.apache.hadoop.yarn.api.resource.PlacementConstraint.AbstractConstraint parseExpression(String constraintStr) throws org.apache.hadoop.yarn.util.constraint.PlacementConstraintParseException
PlacementConstraint.AbstractConstraint,
 this expression can be any valid form of constraint expressions.constraintStr - expression stringPlacementConstraint.AbstractConstraintorg.apache.hadoop.yarn.util.constraint.PlacementConstraintParseException - when given expression
 is malformedpublic static Map<org.apache.hadoop.yarn.util.constraint.PlacementConstraintParser.SourceTags,PlacementConstraint> parsePlacementSpec(String expression) throws org.apache.hadoop.yarn.util.constraint.PlacementConstraintParseException
Tag1(N1),P1:Tag2(N2),P2:...:TagN(Nn),Pn
where TagN(Nn) is a key value pair to determine the source allocation tag and the number of allocations, such as:foo(3)
Optional when using NodeAttribute Constraint. and where Pn can be any form of a valid constraint expression, such as:expression - expression string.org.apache.hadoop.yarn.util.constraint.PlacementConstraintParseException - when the placement constraint parser
 fails to parse an expression.Copyright © 2025 Apache Software Foundation. All rights reserved.