[ 
https://issues.apache.org/jira/browse/YARN-9258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16773682#comment-16773682
 ] 

Weiwei Yang commented on YARN-9258:
-----------------------------------

Hi [~Prabhu Joseph]

It looks almost good. But for the document, I think it needs some refinement. I 
suggested to modify as following,
{noformat}
PlacementSpec              => "" | KeyVal;PlacementSpec
KeyVal                     => SourceTag,ConstraintExpr
SourceTag                  => String(NumContainers)
ConstraintExpr             => SingleConstraint | CompositeConstraint
SingleConstraint           => "IN",Scope,TargetTag | "NOTIN",Scope,TargetTag |  
      "CARDINALITY",Scope,TargetTag,MinCard,MaxCard |  
NodeAttributeConstraintExpr
NodeAttributeConstraintExpr => NodeAttributeName=Value, NodeAttributeName!=Value
CompositeConstraint         => AND(ConstraintList) | OR(ConstraintList)
ConstraintList              => Constraint | Constraint:ConstraintList
NumContainers               => int
Scope                       => "NODE" | "RACK"
TargetTag                   => String
MinCard                     => int
MaxCard                     => int
{noformat}
the main difference to your patch is we don't list {{NodeAttributeConstraint}} 
in {{ConstraintExpr}}, because that is type of \{{SingleConstraint}} actually. 
And slightly modified \{{SourceTag}} format.

For the node attribute, maybe we can have another Jira to add some examples run 
from distributed shell in \{{NodeAttributes.md}}. So in 
\{{PlacementConstraints.md}}, we can simply add a link to that. Would make more 
sense for people to read.

Thanks

> Support to specify allocation tags without constraint in distributed shell CLI
> ------------------------------------------------------------------------------
>
>                 Key: YARN-9258
>                 URL: https://issues.apache.org/jira/browse/YARN-9258
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: distributed-shell
>    Affects Versions: 3.1.0
>            Reporter: Prabhu Joseph
>            Assignee: Prabhu Joseph
>            Priority: Major
>         Attachments: YARN-9258-001.patch, YARN-9258-002.patch, 
> YARN-9258-003.patch
>
>
> DistributedShell PlacementSpec fails to parse 
> {color:#d04437}zk=1:spark=1,NOTIN,NODE,zk{color}
> {code}
> java.lang.IllegalArgumentException: Invalid placement spec: 
> zk=1:spark=1,NOTIN,NODE,zk
>       at 
> org.apache.hadoop.yarn.applications.distributedshell.PlacementSpec.parse(PlacementSpec.java:108)
>       at 
> org.apache.hadoop.yarn.applications.distributedshell.Client.init(Client.java:462)
>       at 
> org.apache.hadoop.yarn.applications.distributedshell.TestDistributedShell.testDistributedShellWithPlacementConstraint(TestDistributedShell.java:1780)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>       at 
> org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
>       at 
> org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>       at java.lang.Thread.run(Thread.java:745)
> Caused by: 
> org.apache.hadoop.yarn.util.constraint.PlacementConstraintParseException: 
> Source allocation tags is required for a multi placement constraint 
> expression.
>       at 
> org.apache.hadoop.yarn.util.constraint.PlacementConstraintParser.parsePlacementSpec(PlacementConstraintParser.java:740)
>       at 
> org.apache.hadoop.yarn.applications.distributedshell.PlacementSpec.parse(PlacementSpec.java:94)
>       ... 16 more
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to