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

Jian He commented on YARN-2762:
-------------------------------

looks good, one minor comment:
we can have a common method for this:
{code}
    Set<String> labels = new HashSet<String>();
    for (String p : args.split(",")) {
      if (!p.trim().isEmpty()) {
        labels.add(p.trim());
      }
    }
    if (labels.isEmpty()) {
      throw new IllegalArgumentException(NO_LABEL_ERR_MSG);
    }
{code}

> 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.1.patch, YARN-2762.2.patch, YARN-2762.2.patch, 
> YARN-2762.3.patch, YARN-2762.4.patch, YARN-2762.5.patch, YARN-2762.6.patch, 
> 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