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

Yu-Tang Lin commented on YARN-6781:
-----------------------------------

Hi [#Sunil G ],  I just checked the code of these two failed test cases. The 
error in testInitializeResourcesMapErrors() could be fixed easily by remove the 
redundant argument; but in testInitializeResourcesMapErrors(), the follow-up 
steps will check the value in Map object, that means after this code changes, 
this test case will be always failed. 
How do you think if we modify the code like this:

{code:java}
void initializeResourcesMap(Configuration conf){
  initializeResourcesMap(conf, null);
}
void initializeResourcesMap(Configuration conf, Map<String, 
ResourceInformation> ret){
  if(ret == null) {
    ret = new HashMap<>();
  }
...
}
{code}
Only the test will call the second method directly.

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to