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

Wangda Tan commented on YARN-2762:
----------------------------------

[~rohithsharma],
Thanks for patch, I've updated the title a little bit to make it better 
describe what we want, 

Even though, with YARN-2843, all hosts/labels will be trimmed to make sure the 
correctness, but it is also good to have this checking in CLI side.

Some suggestions:
1) Every labels should be trimmed before sending to RM
2) When there's no labels after trimmed, we should use the same error message 
as 
{code}
      else if ("-addToClusterNodeLabels".equals(cmd)) {
        if (i >= args.length) {
          System.err.println("No cluster node-labels are specified");
          exitCode = -1;
        } else {
          exitCode = addToClusterNodeLabels(args[i]);
        }
      }
{code}
To make it consistent.
3) There's one error message is not correct 
{code}
else if ("-replaceLabelsOnNode".equals(cmd)) {
        if (i >= args.length) {
          System.err.println("No cluster node-labels are specified");
          exitCode = -1;
        } else {
          exitCode = replaceLabelsOnNodes(args[i]);
        }
{code}
It should be "no node-labels are specified when trying to replace labels on 
node" or something, I suggest you can address this together with your patch.

Thanks,
Wangda

> RMAdminCLI node-labels-related args should be trimmed and checked before 
> sending to RM
> --------------------------------------------------------------------------------------
>
>                 Key: YARN-2762
>                 URL: https://issues.apache.org/jira/browse/YARN-2762
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager
>            Reporter: Rohith
>            Assignee: Rohith
>            Priority: Minor
>         Attachments: YARN-2762.patch
>
>
> All NodeLabel args validation's are done at server side. The same can be done 
> at RMAdminCLI so that unnecessary RPC calls can be avoided.
> And for the input such as "x,y,,z,", no need to add empty string instead can 
> be skipped.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to