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

Jian He commented on YARN-3092:
-------------------------------

looks good overall.
- minor optimization, return the reference directly if not existing
{code}
    if (!usages.containsKey(label)) {
      usages.put(label, new UsageByLabel(label));
    }
    return usages.get(label);
{code}
- demand -> pending?

- test case, just throw exception for better readability.
{code}
NoSuchMethodException,
      SecurityException, IllegalAccessException, IllegalArgumentException,
      InvocationTargetException
{code}
- the new class can be inside scheduler package

> Create common resource usage class to track labeled resource/capacity in 
> Capacity Scheduler
> -------------------------------------------------------------------------------------------
>
>                 Key: YARN-3092
>                 URL: https://issues.apache.org/jira/browse/YARN-3092
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: api, client, resourcemanager
>            Reporter: Wangda Tan
>            Assignee: Wangda Tan
>         Attachments: YARN-3092.1.patch
>
>
> Since we have labels on nodes, so we need to track resource usage *by 
> labels*, includes
> - AM resource (to enforce max-am-resource-by-label after YARN-2637)
> - Used resource (includes AM resource usage)
> - Reserved resource
> - Pending resource
> - Headroom
> Benefits to have such a common class are:
> - Reuse lots of code in different places (Queue/App/User), better 
> maintainability and readability.
> - Can make fine-grained locking (e.g. accessing used resource in a queue 
> doesn't need lock a queue)



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

Reply via email to