From b61b48999530851da177db2e8998858ffc01f77e Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Sat, 6 Jun 2015 18:47:45 -0700 Subject: [PATCH] HDFS-8116. Cleanup uncessary if LOG.isDebugEnabled() from RollingWindowManager. Contributed by Brahma Reddy Battula. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../server/namenode/top/window/RollingWindowManager.java | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index f7f7f9810f..21f587fd2d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/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 diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/top/window/RollingWindowManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/top/window/RollingWindowManager.java index 4759cc8ca5..63438ff415 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/top/window/RollingWindowManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/top/window/RollingWindowManager.java @@ -187,11 +187,9 @@ public void recordMetric(long time, String command, String user, long delta) { */ public TopWindow snapshot(long time) { TopWindow window = new TopWindow(windowLenMs); - if (LOG.isDebugEnabled()) { - Set metricNames = metricMap.keySet(); - LOG.debug("iterating in reported metrics, size={} values={}", - metricNames.size(), metricNames); - } + Set metricNames = metricMap.keySet(); + LOG.debug("iterating in reported metrics, size={} values={}", + metricNames.size(), metricNames); for (Map.Entry entry : metricMap.entrySet()) { String metricName = entry.getKey(); RollingWindowMap rollingWindows = entry.getValue();