From 0da0bf0de229b2fec033e22bf8530c7484fbb848 Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Fri, 11 Nov 2016 14:30:53 -0800 Subject: [PATCH] HDFS-10941. Improve BlockManager#processMisReplicatesAsync log. Contributed by Chen Liang. (cherry picked from commit 4484b48498b2ab2a40a404c487c7a4e875df10dc) (cherry picked from commit c443ecb267b25577f7abc058b0b5e13592d4c040) --- .../hadoop/hdfs/server/blockmanagement/BlockManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 01fd66c83c3..b4b5b5f7fe7 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 @@ -2741,24 +2741,26 @@ public class BlockManager { while (processed < numBlocksPerIteration && blocksItr.hasNext()) { BlockInfoContiguous block = blocksItr.next(); MisReplicationResult res = processMisReplicatedBlock(block); - if (LOG.isTraceEnabled()) { - LOG.trace("block " + block + ": " + res); - } switch (res) { case UNDER_REPLICATED: + LOG.trace("under replicated block {}: {}", block, res); nrUnderReplicated++; break; case OVER_REPLICATED: + LOG.trace("over replicated block {}: {}", block, res); nrOverReplicated++; break; case INVALID: + LOG.trace("invalid block {}: {}", block, res); nrInvalid++; break; case POSTPONE: + LOG.trace("postpone block {}: {}", block, res); nrPostponed++; postponeBlock(block); break; case UNDER_CONSTRUCTION: + LOG.trace("under construction block {}: {}", block, res); nrUnderConstruction++; break; case OK: