Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.9.0
-
None
-
Reviewed
Description
Nodemanager build shows a findbugs warning
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.
There are also several checkstyle errors in the same class org.apache.hadoop.yarn.server.nodemanager.ContainerExecutorContainerExecutor
[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.