[
https://issues.apache.org/jira/browse/YARN-7921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16360283#comment-16360283
]
Weiwei Yang commented on YARN-7921:
-----------------------------------
Thanks [~kkaranasos] for the quick feedback. I agree that to follow same syntax
as in the doc, but want to double check if we are referring to the same doc. I
am referring to what was done for DS like following:
{code}
NOTIN,NODE,zk
IN,RACK,zk
CARDINALITY,NODE,hbase,1,3
{code}
I have implemented a parser \{{PlacementConstraintParser}} which is able to
parse such expressions to a corresponding java instance, e.g
{code}
// 1) parse a string expression to an AbstractConstraint
AbstractConstraint constraint =
PlacementConstraintParser.parseExpression("NOTIN,NODE,zk");
// 2) transform an AbstractConstraint to a string expression
constraint.toString();
// this returns "NOTIN,NODE,zk"
{code}
what I was trying to do with this task is to implement 2). Which will be done
by implementing \{{AbstractConstraint#toString}} methods.
Please share your thoughts on this.
Thanks.
> Transform a PlacementConstraint to a string expression
> ------------------------------------------------------
>
> Key: YARN-7921
> URL: https://issues.apache.org/jira/browse/YARN-7921
> Project: Hadoop YARN
> Issue Type: Sub-task
> Reporter: Weiwei Yang
> Assignee: Weiwei Yang
> Priority: Major
>
> Purpose:
> Let placement constraint viewable on UI or log, e.g print app placement
> constraint in RM app page. Help user to use constraints and analysis
> placement issues easier.
> Propose:
> Like what was added for DS, toString is a reversed process of
> {{PlacementConstraintParser}} that transforms a PlacementConstraint to a
> string, using same syntax. E.g
> {code}
> AbstractConstraint constraintExpr = targetIn(NODE, allocationTag("hbase-m"));
> constraint.toString();
> // This prints: IN,NODE,hbase-m
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]