浏览代码

HDFS-8116. Cleanup uncessary if LOG.isDebugEnabled() from RollingWindowManager. Contributed by Brahma Reddy Battula.

Xiaoyu Yao 10 年之前
父节点
当前提交
b61b489995

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -606,6 +606,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-8432. Introduce a minimum compatible layout version to allow downgrade
     in more rolling upgrade use cases. (cnauroth)
 
+    HDFS-8116. Cleanup uncessary if LOG.isDebugEnabled() from
+    RollingWindowManager. (Brahma Reddy Battula via xyao)
+
   OPTIMIZATIONS
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

+ 3 - 5
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/top/window/RollingWindowManager.java

@@ -187,11 +187,9 @@ public class RollingWindowManager {
    */
   public TopWindow snapshot(long time) {
     TopWindow window = new TopWindow(windowLenMs);
-    if (LOG.isDebugEnabled()) {
-      Set<String> metricNames = metricMap.keySet();
-      LOG.debug("iterating in reported metrics, size={} values={}",
-          metricNames.size(), metricNames);
-    }
+    Set<String> metricNames = metricMap.keySet();
+    LOG.debug("iterating in reported metrics, size={} values={}",
+        metricNames.size(), metricNames);
     for (Map.Entry<String, RollingWindowMap> entry : metricMap.entrySet()) {
       String metricName = entry.getKey();
       RollingWindowMap rollingWindows = entry.getValue();