Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-6515

Fix warnings from Spotbugs in hadoop-yarn-server-nodemanager

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-beta1
    • Component/s: nodemanager
    • Labels:
      None

      Description

      5 find bugs issue was reported NM project as part of the YARN-4166 build
      Issue 1:
      org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainerMetrics.usageMetrics is a mutable collection which should be package protected
      Bug type MS_MUTABLE_COLLECTION_PKGPROTECT (click for details)
      In class org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainerMetrics
      Field org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainerMetrics.usageMetrics
      At ContainerMetrics.java:[line 134]

      Issue 2:
      org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ContainerLocalizer.createStatus() 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.containermanager.localizer.ContainerLocalizer
      In method org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ContainerLocalizer.createStatus()
      Field org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ContainerLocalizer.pendingResources
      At ContainerLocalizer.java:[line 334]

      Issue 3:
      org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl.removeVeryOldStoppedContainersFromCache() 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.NodeStatusUpdaterImpl
      In method org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl.removeVeryOldStoppedContainersFromCache()
      Field org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl.recentlyStoppedContainers
      At NodeStatusUpdaterImpl.java:[line 721]

      Issue 4:
      Hard coded reference to an absolute pathname in org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.DockerLinuxContainerRuntime.launchContainer(ContainerRuntimeContext)
      Bug type DMI_HARDCODED_ABSOLUTE_FILENAME (click for details)
      In class org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.DockerLinuxContainerRuntime
      In method org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.DockerLinuxContainerRuntime.launchContainer(ContainerRuntimeContext)
      File name /sys/fs/cgroup
      At DockerLinuxContainerRuntime.java:[line 455]

      Useless object stored in variable removedNullContainers of method org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl.removeOrTrackCompletedContainersFromContext(List)
      Bug type UC_USELESS_OBJECT (click for details)
      In class org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl
      In method org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl.removeOrTrackCompletedContainersFromContext(List)
      Value removedNullContainers
      Type java.util.HashSet
      At NodeStatusUpdaterImpl.java:[line 644]

        Attachments

        1. YARN-6515.002.patch
          6 kB
          Naganarasimha G R
        2. YARN-6515.001.patch
          12 kB
          Naganarasimha G R

          Issue Links

            Activity

              People

              • Assignee:
                Naganarasimha Naganarasimha G R
                Reporter:
                Naganarasimha Naganarasimha G R
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: