@Public
@Unstable
public final class PlacementConstraintParser
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
PlacementConstraintParser.BaseStringTokenizer |
A basic tokenizer that splits an expression by a given delimiter.
|
static class |
PlacementConstraintParser.CardinalityConstraintParser |
Constraint parser used to parse a given target expression, such as
"cardinality, NODE, foo, 0, 1".
|
static class |
PlacementConstraintParser.ConjunctionConstraintParser |
Parser used to parse conjunction form of constraints, such as
AND(A, ..., B), OR(A, ..., B).
|
static class |
PlacementConstraintParser.ConjunctionTokenizer |
Tokenizer used to parse conjunction form of a constraint expression,
[AND|OR](C1:C2:...:Cn).
|
static class |
PlacementConstraintParser.ConstraintParser |
Constraint Parser used to parse placement constraints from a
given expression.
|
static interface |
PlacementConstraintParser.ConstraintTokenizer |
Tokenizer interface that used to parse an expression.
|
static class |
PlacementConstraintParser.MultipleConstraintsTokenizer |
Tokenizer used to handle a placement spec composed by multiple
constraint expressions.
|
static class |
PlacementConstraintParser.NodeConstraintParser |
Constraint parser used to parse a given target expression.
|
static class |
PlacementConstraintParser.SourceTags |
A helper class to encapsulate source tags and allocations in the
placement specification.
|
static class |
PlacementConstraintParser.SourceTagsTokenizer |
Tokenizer used to parse allocation tags expression, which should be
in tag(numOfAllocations) syntax.
|
static class |
PlacementConstraintParser.TargetConstraintParser |
Constraint parser used to parse a given target expression, such as
"NOTIN, NODE, foo, bar".
|
| Modifier and Type | Field | Description |
|---|---|---|
static char |
EXPRESSION_VAL_DELIM |
| Modifier and Type | Method | Description |
|---|---|---|
static PlacementConstraint.AbstractConstraint |
parseExpression(java.lang.String constraintStr) |
Parses a given constraint expression to a
PlacementConstraint.AbstractConstraint,
this expression can be any valid form of constraint expressions. |
static java.util.Map<PlacementConstraintParser.SourceTags,PlacementConstraint> |
parsePlacementSpec(java.lang.String expression) |
Parses a placement constraint specification.
|
public static final char EXPRESSION_VAL_DELIM
public static PlacementConstraint.AbstractConstraint parseExpression(java.lang.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 java.util.Map<PlacementConstraintParser.SourceTags,PlacementConstraint> parsePlacementSpec(java.lang.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.PlacementConstraintParseException - when the placement constraint parser
fails to parse an expression.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.