HDFS-10941. Improve BlockManager#processMisReplicatesAsync log. Contributed by Chen Liang.

This commit is contained in:
Xiaoyu Yao 2016-11-11 14:30:53 -08:00
parent ede1a473f5
commit 4484b48498
1 changed files with 5 additions and 3 deletions

View File

@ -3232,24 +3232,26 @@ public class BlockManager implements BlockStatsMXBean {
while (processed < numBlocksPerIteration && blocksItr.hasNext()) { while (processed < numBlocksPerIteration && blocksItr.hasNext()) {
BlockInfo block = blocksItr.next(); BlockInfo block = blocksItr.next();
MisReplicationResult res = processMisReplicatedBlock(block); MisReplicationResult res = processMisReplicatedBlock(block);
if (LOG.isTraceEnabled()) {
LOG.trace("block " + block + ": " + res);
}
switch (res) { switch (res) {
case UNDER_REPLICATED: case UNDER_REPLICATED:
LOG.trace("under replicated block {}: {}", block, res);
nrUnderReplicated++; nrUnderReplicated++;
break; break;
case OVER_REPLICATED: case OVER_REPLICATED:
LOG.trace("over replicated block {}: {}", block, res);
nrOverReplicated++; nrOverReplicated++;
break; break;
case INVALID: case INVALID:
LOG.trace("invalid block {}: {}", block, res);
nrInvalid++; nrInvalid++;
break; break;
case POSTPONE: case POSTPONE:
LOG.trace("postpone block {}: {}", block, res);
nrPostponed++; nrPostponed++;
postponeBlock(block); postponeBlock(block);
break; break;
case UNDER_CONSTRUCTION: case UNDER_CONSTRUCTION:
LOG.trace("under construction block {}: {}", block, res);
nrUnderConstruction++; nrUnderConstruction++;
break; break;
case OK: case OK: