@InterfaceAudience.Public @InterfaceStability.Unstable public final class PlacementConstraintParser extends Object
| Modifier and Type | Class and Description | 
|---|---|
| static class  | PlacementConstraintParser.BaseStringTokenizerA basic tokenizer that splits an expression by a given delimiter. | 
| static class  | PlacementConstraintParser.CardinalityConstraintParserConstraint parser used to parse a given target expression, such as
 "cardinality, NODE, foo, 0, 1". | 
| static class  | PlacementConstraintParser.ConjunctionConstraintParserParser used to parse conjunction form of constraints, such as
 AND(A, ..., B), OR(A, ..., B). | 
| static class  | PlacementConstraintParser.ConjunctionTokenizerTokenizer used to parse conjunction form of a constraint expression,
 [AND|OR](C1:C2:...:Cn). | 
| static class  | PlacementConstraintParser.ConstraintParserConstraint Parser used to parse placement constraints from a
 given expression. | 
| static interface  | PlacementConstraintParser.ConstraintTokenizerTokenizer interface that used to parse an expression. | 
| static class  | PlacementConstraintParser.MultipleConstraintsTokenizerTokenizer used to handle a placement spec composed by multiple
 constraint expressions. | 
| static class  | PlacementConstraintParser.NodeConstraintParserConstraint parser used to parse a given target expression. | 
| static class  | PlacementConstraintParser.SourceTagsA helper class to encapsulate source tags and allocations in the
 placement specification. | 
| static class  | PlacementConstraintParser.SourceTagsTokenizerTokenizer used to parse allocation tags expression, which should be
 in tag(numOfAllocations) syntax. | 
| static class  | PlacementConstraintParser.TargetConstraintParserConstraint parser used to parse a given target expression, such as
 "NOTIN, NODE, foo, bar". | 
| Modifier and Type | Field and Description | 
|---|---|
| static char | EXPRESSION_VAL_DELIM | 
| Modifier and Type | Method and Description | 
|---|---|
| static 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<PlacementConstraintParser.SourceTags,PlacementConstraint> | parsePlacementSpec(String expression)Parses a placement constraint specification. | 
public static final char EXPRESSION_VAL_DELIM
public static PlacementConstraint.AbstractConstraint parseExpression(String constraintStr) throws PlacementConstraintParseException
PlacementConstraint.AbstractConstraint,
 this expression can be any valid form of constraint expressions.constraintStr - expression stringPlacementConstraint.AbstractConstraintPlacementConstraintParseException - when given expression
 is malformedpublic static Map<PlacementConstraintParser.SourceTags,PlacementConstraint> parsePlacementSpec(String expression) throws 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.PlacementConstraintParseExceptionCopyright © 2008–2023 Apache Software Foundation. All rights reserved.