Junping Du commented on YARN-3304:

I have uploaded the v3 patch with adding a new API of check availability. You 
can see it is not so complicated and very handy to use. We don't even need any 
changes happen in ContainerMetrics side in YARN-3392 (except fixing some race 
condition there which is good). 
If we go on with negative value, not even saying MR resource metrics counter 
will get negative value, we also need to provide negative value to memory 
resource when it is not available (now it is 0), and make some existing code 
(like below) to handle negative value which doesn't sound elegant to me.
                    containerId, containerMetricsPeriodMs).recordMemoryUsage(
                    (int) (currentPmemUsage >> 20));

> ResourceCalculatorProcessTree#getCpuUsagePercent default return value is 
> inconsistent with other getters
> --------------------------------------------------------------------------------------------------------
>                 Key: YARN-3304
>                 URL: https://issues.apache.org/jira/browse/YARN-3304
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: nodemanager
>            Reporter: Junping Du
>            Assignee: Karthik Kambatla
>            Priority: Blocker
>         Attachments: YARN-3212-v3.patch, YARN-3304-v2.patch, YARN-3304.patch
> Per discussions in YARN-3296, getCpuUsagePercent() will return -1 for 
> unavailable case while other resource metrics are return 0 in the same case 
> which sounds inconsistent.

This message was sent by Atlassian JIRA

Reply via email to