hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sunil G (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-6781) ResourceUtils.initializeResourcesMap() takes an unnecessary Map parameter
Date Wed, 16 Aug 2017 15:09:01 GMT

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

Sunil G commented on YARN-6781:
-------------------------------

In ResourceUtils
{code}
  @VisibleForTesting
  public static void resetResourceTypes(Configuration conf) {
    synchronized (ResourceUtils.class) {
      initializedResources = false;
    }
    getResourceTypes(conf);
  }
{code}

IMHO, above method could be changed to return resource map and that could be used for later
computations.

Call chain goes like this resetResourceTypes -> getResourceTypes-> initializeResourcesMap


> ResourceUtils.initializeResourcesMap() takes an unnecessary Map parameter
> -------------------------------------------------------------------------
>
>                 Key: YARN-6781
>                 URL: https://issues.apache.org/jira/browse/YARN-6781
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager
>    Affects Versions: YARN-3926
>            Reporter: Daniel Templeton
>            Assignee: Yu-Tang Lin
>            Priority: Minor
>              Labels: newbie
>             Fix For: YARN-3926
>
>         Attachments: YARN-6781.001.patch, YARN-6781-YARN-3926.002.patch
>
>
> The {{resourceInformationMap}} parameter is always passed in as a new {{Map}} object,
and it's never referenced again after the call.  The parameter can be eliminated.  Instead
the {{Map}} can be created inside the {{initializeResourcesMap()}} method.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org


Mime
View raw message