[ 
https://issues.apache.org/jira/browse/YARN-5383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vrushali C updated YARN-5383:
-----------------------------
    Description: 
Nodemanager build shows a findbugs warning

{code}
Performance Warnings

Code    Warning
WMI     
org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.writeLaunchEnv(OutputStream,
 Map, Map, List, Path, String) makes inefficient use of keySet iterator instead 
of entrySet iterator
Bug type WMI_WRONG_MAP_ITERATOR (click for details) 
In class org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor
In method 
org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.writeLaunchEnv(OutputStream,
 Map, Map, List, Path, String)
At ContainerExecutor.java:[line 330]

Details

WMI_WRONG_MAP_ITERATOR: Inefficient use of keySet iterator instead of entrySet 
iterator

This method accesses the value of a Map entry, using a key that was retrieved 
from a keySet iterator. It is more efficient to use an iterator on the entrySet 
of the map, to avoid the Map.get(key) lookup.
{code}


There are also several checkstyle errors in the same class 
org.apache.hadoop.yarn.server.nodemanager.ContainerExecutorContainerExecutor

{code}
[ERROR] 
src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[308]
 (indentation) Indentation: 'ContainerLaunch' have incorrect indentation level 
6, expected level should be 8.
[ERROR] 
src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[319:29]
 (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
[ERROR] 
src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[474:52]
 (coding) HiddenField: 'conf' hides a field.
[ERROR] 
src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[497:52]
 (coding) HiddenField: 'conf' hides a field.
[ERROR] 
src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[522:52]
 (coding) HiddenField: 'conf' hides a field.
[ERROR] 
src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[529]
 (sizes) LineLength: Line is longer than 80 characters (found 81).
[ERROR] 
src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[571:21]
 (coding) HiddenField: 'conf' hides a field.
{code}

  was:

Nodemanager build shows a findbugs warning

{code}
Performance Warnings

Code    Warning
WMI     
org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.writeLaunchEnv(OutputStream,
 Map, Map, List, Path, String) makes inefficient use of keySet iterator instead 
of entrySet iterator
Bug type WMI_WRONG_MAP_ITERATOR (click for details) 
In class org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor
In method 
org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.writeLaunchEnv(OutputStream,
 Map, Map, List, Path, String)
At ContainerExecutor.java:[line 330]

Details

WMI_WRONG_MAP_ITERATOR: Inefficient use of keySet iterator instead of entrySet 
iterator

This method accesses the value of a Map entry, using a key that was retrieved 
from a keySet iterator. It is more efficient to use an iterator on the entrySet 
of the map, to avoid the Map.get(key) lookup.
{code}




> Fix findbugs for nodemanager & checkstyle warnings in 
> nodemanager.ContainerExecutor
> -----------------------------------------------------------------------------------
>
>                 Key: YARN-5383
>                 URL: https://issues.apache.org/jira/browse/YARN-5383
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 3.0.0-alpha1
>            Reporter: Vrushali C
>            Assignee: Vrushali C
>
> Nodemanager build shows a findbugs warning
> {code}
> Performance Warnings
> Code  Warning
> WMI   
> org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.writeLaunchEnv(OutputStream,
>  Map, Map, List, Path, String) makes inefficient use of keySet iterator 
> instead of entrySet iterator
> Bug type WMI_WRONG_MAP_ITERATOR (click for details) 
> In class org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor
> In method 
> org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.writeLaunchEnv(OutputStream,
>  Map, Map, List, Path, String)
> At ContainerExecutor.java:[line 330]
> Details
> WMI_WRONG_MAP_ITERATOR: Inefficient use of keySet iterator instead of 
> entrySet iterator
> This method accesses the value of a Map entry, using a key that was retrieved 
> from a keySet iterator. It is more efficient to use an iterator on the 
> entrySet of the map, to avoid the Map.get(key) lookup.
> {code}
> There are also several checkstyle errors in the same class 
> org.apache.hadoop.yarn.server.nodemanager.ContainerExecutorContainerExecutor
> {code}
> [ERROR] 
> src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[308]
>  (indentation) Indentation: 'ContainerLaunch' have incorrect indentation 
> level 6, expected level should be 8.
> [ERROR] 
> src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[319:29]
>  (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
> [ERROR] 
> src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[474:52]
>  (coding) HiddenField: 'conf' hides a field.
> [ERROR] 
> src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[497:52]
>  (coding) HiddenField: 'conf' hides a field.
> [ERROR] 
> src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[522:52]
>  (coding) HiddenField: 'conf' hides a field.
> [ERROR] 
> src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[529]
>  (sizes) LineLength: Line is longer than 80 characters (found 81).
> [ERROR] 
> src/main/java/org/apache/hadoop/yarn/server/nodemanager/ContainerExecutor.java[571:21]
>  (coding) HiddenField: 'conf' hides a field.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to