hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niranjan Singh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-588) Two identical utility methods in different classes to build Resource
Date Thu, 13 Jun 2013 22:27:21 GMT

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

Niranjan Singh commented on YARN-588:

As of now I have not removed the single-argument Resources#createResource,before I remove
the method I just wanted to discuss what could be the ramifications of certain method calls
when calling this method ,as the second argument is going to be hard coded or given some arbitrary
value.Some of the methods are listed below :

1. public Resource divideAndCeil(Resource numerator, int denominator) {
    return Resources.createResource(
        divideAndCeil(numerator.getMemory(), denominator));
    //Here the changes I propose is
    return Resource.newInstance(divideAndCeil(numerator.getMemory(), denominator)), //some
value); //hard code

2.public Resource roundUp(Resource r, Resource minimumResource) {
    return Resources.createResource(
     //Here the changes I propose is
    return Resource.newInstance(roundUp(r.getMemory(),minimumResource.getMemory()), //some
value);//hard code

            YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB), //some value);

Conclusion: Will it be correct to pass some random value as the second paramenter(//some value)
or is it  sufficient to just hard code 0 or 1?

> Two identical utility methods in different classes to build Resource
> --------------------------------------------------------------------
>                 Key: YARN-588
>                 URL: https://issues.apache.org/jira/browse/YARN-588
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: api
>    Affects Versions: 2.0.3-alpha
>            Reporter: Sandy Ryza
>            Assignee: Niranjan Singh
>            Priority: Minor
>              Labels: newbie
>         Attachments: YARN-588.patch, YARN-588.patch
> Both Resources and BuilderUtils have a method that takes the same arguments to build
a Resource object.  The code doesn't need both of these methods.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message