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

Sunil Govindan commented on YARN-8524:
--------------------------------------

Thanks [~snemeth]

{{LightWeightResource}} ctor is not very clean and hence moving to a more 
cleaner api seems better. We are still using Resource.newInstance in many 
places, so a complete migration to use only Resources api is still far.

As a starter, I am fine with your approach of making it cleaner.

Some comments in general:

1. {{new LightWeightResource(value, (int) value);}} Typecasting to int is not 
good. You can use Long ... intValue()

2. Pls add a test case when only memory and cpu configured. (no extra resources)

 

> Single parameter Resource / LightWeightResource constructor looks confusing
> ---------------------------------------------------------------------------
>
>                 Key: YARN-8524
>                 URL: https://issues.apache.org/jira/browse/YARN-8524
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: api
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Major
>         Attachments: YARN-8524.001.patch, YARN-8524.002.patch
>
>
> The single parameter (long) constructor in Resource / LightWeightResource 
> sets all resource components to the same value.
> Since there are other constructors in these classes with (long, int) 
> parameters where the semantics are different, it could be confusing for the 
> users.
> The perfect place to create such a resource would be in the Resources class, 
> with a method named like "createResourceWithSameValue".



--
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