@InterfaceAudience.Public @InterfaceStability.Unstable public final class PlacementConstraintParser extends Object
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 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.AbstractConstraint
org.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
and where Pn can be any form of a valid constraint expression, such as:expression
- expression string.org.apache.hadoop.yarn.util.constraint.PlacementConstraintParseException
Copyright © 2019 Apache Software Foundation. All rights reserved.