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

Wangda Tan commented on YARN-3521:
----------------------------------

Just tried to deploy and see the REST API result, some comments:

1. label-mappings

{code}
<entry>
<key>
<name>y</name>
<exclusivity>true</exclusivity>
</key>
<value>
<nodeIDsList>host2:0</nodeIDsList>
</value>
</entry>
{code}

I think it's better to rename {{nodeIDsList}} to {{node}}, so the result will 
be 
{code}
...
<value>
        <node>host1:1234</node>
        <node>host2:5678</node>
</value>
{code}

2. nodeLabelsInfo:
Now it is:
{code}
<nodeLabelsInfo>
<nodeLabels>
<name>x</name>
<exclusivity>true</exclusivity>
</nodeLabels>
<nodeLabels>
<name>y</name>
<exclusivity>true</exclusivity>
</nodeLabels>
</nodeLabelsInfo>
{code}

I suggest to change 
{code}
  @XmlElement(name = "nodeLabelsInfo")
  protected ArrayList<NodeLabelInfo> nodeLabelsInfo =
      new ArrayList<NodeLabelInfo>();
{code}
To
{{name="nodeLabelInfo"}}

So the result will be:
{code}
<nodeLabelsInfo>
    <nodeLabelInfo>
        <name>x</name>
        <exclusivity>true</exclusivity>
    </nodeLabelInfo>
    <nodeLabelInfo>
        <name>y</name>
        <exclusivity>true</exclusivity>
    </nodeLabelInfo>
</nodeLabelsInfo>
{code}

3. nodeToLabelsName:
I suggest to add a {{@XmlRootElement(name = "nodeLabelName")}} to 
NodeLabelsName.nodeLabels to make the result to be:
{code}
<nodeToLabelsName>
    <nodeToLabels>
        <entry>
            <key>node1</key>
            <value>
                <nodeLabelName>x</nodeLabelName>
            </value>
        </entry>
        <entry>
            <key>node2</key>
            <value>
                <nodeLabelName>y</nodeLabelName>
            </value>
        </entry>
        <entry>
            <key>node3</key>
            <value>
                <nodeLabelName>y</nodeLabelName>
                <nodeLabelName>z</nodeLabelName>
            </value>
        </entry>
    </nodeToLabels>
</nodeToLabelsName>
{code}



> Support return structured NodeLabel objects in REST API when call 
> getClusterNodeLabels
> --------------------------------------------------------------------------------------
>
>                 Key: YARN-3521
>                 URL: https://issues.apache.org/jira/browse/YARN-3521
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: api, client, resourcemanager
>            Reporter: Wangda Tan
>            Assignee: Sunil G
>         Attachments: 0001-YARN-3521.patch, 0002-YARN-3521.patch, 
> 0003-YARN-3521.patch, 0004-YARN-3521.patch, 0005-YARN-3521.patch
>
>
> In YARN-3413, yarn cluster CLI returns NodeLabel instead of String, we should 
> make the same change in REST API side to make them consistency.



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

Reply via email to