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

Szilard Nemeth commented on YARN-9318:
--------------------------------------

Hi [~templedf]!

Thanks for the review!

1. / 2. As discussed offline, we should create a follow-up jira (will do that 
when this merged) where most of the code duplications are fixed (with or 
without lambdas) and keep this as simple as possible.
3. As discussed, removing continue did not change the behavior so it's safe.
4. Fixed.
5. Added a generic error message. As any of the multiple component resources 
can have an invalid value, I can't really add a specific error message. 
Anyway, having this kind of output from a test result makes straightforward to 
pinpoint what the issue is, I think: 

{code:java}
java.lang.AssertionError: 
Expected :<memory:4, vCores:2, resource2: 8>
Actual   :<memory:5, vCores:2, resource2: 8>
{code}

Additional notes: I felt weird while thinking about using a boolean for up or 
down. So I introduced a private enum for the rounding direction instead and 
extracted the bulk of the rounding methods to a common one.

Thanks!

> Resources#multiplyAndRoundUp does not consider Resource Types
> -------------------------------------------------------------
>
>                 Key: YARN-9318
>                 URL: https://issues.apache.org/jira/browse/YARN-9318
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Major
>         Attachments: YARN-9318.001.patch, YARN-9318.002.patch, 
> YARN-9318.003.patch
>
>
> org.apache.hadoop.yarn.util.resource.Resources#multiplyAndRoundUp only deals 
> with memory and vcores while computing the rounded value. It should also 
> consider custom Resource Types as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to