diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 4c62a012086..5afcecade81 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1872,6 +1872,8 @@ Release 2.8.0 - UNRELEASED HDFS-6832. Fix the usage of 'hdfs namenode' command. (Manjunath Ballur via aajisaka) + HDFS-9839. Reduce verbosity of processReport logging. (Arpit Agarwal) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java index cb23b9a3437..fb0707b906b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java @@ -1865,7 +1865,7 @@ public class BlockManager implements BlockStatsMXBean { final long startTime = Time.monotonicNow(); //after acquiring write lock final long endTime; DatanodeDescriptor node; - Collection invalidatedBlocks = null; + Collection invalidatedBlocks = Collections.emptyList(); try { node = datanodeManager.getDatanode(nodeID); @@ -1940,11 +1940,9 @@ public class BlockManager implements BlockStatsMXBean { namesystem.writeUnlock(); } - if (invalidatedBlocks != null) { - for (Block b : invalidatedBlocks) { - blockLog.info("BLOCK* processReport: {} on node {} size {} does not " + - "belong to any file", b, node, b.getNumBytes()); - } + for (Block b : invalidatedBlocks) { + blockLog.debug("BLOCK* processReport: {} on node {} size {} does not " + + "belong to any file", b, node, b.getNumBytes()); } // Log the block report processing stats from Namenode perspective @@ -1953,9 +1951,11 @@ public class BlockManager implements BlockStatsMXBean { metrics.addBlockReport((int) (endTime - startTime)); } blockLog.info("BLOCK* processReport: from storage {} node {}, " + - "blocks: {}, hasStaleStorage: {}, processing time: {} msecs", storage - .getStorageID(), nodeID, newReport.getNumberOfBlocks(), - node.hasStaleStorages(), (endTime - startTime)); + "blocks: {}, hasStaleStorage: {}, processing time: {} msecs, " + + "invalidatedBlocks: {}", storage.getStorageID(), nodeID, + newReport.getNumberOfBlocks(), + node.hasStaleStorages(), (endTime - startTime), + invalidatedBlocks.size()); return !node.hasStaleStorages(); }