HDFS-9839. Reduce verbosity of processReport logging. (Contributed by Arpit Agarwal)

This closes #78
This commit is contained in:
Arpit Agarwal 2016-02-20 23:19:09 -08:00
parent d31660ef4a
commit 4823fbb490
2 changed files with 11 additions and 9 deletions

View File

@ -1785,6 +1785,8 @@ Release 2.8.0 - UNRELEASED
HDFS-6832. Fix the usage of 'hdfs namenode' command. HDFS-6832. Fix the usage of 'hdfs namenode' command.
(Manjunath Ballur via aajisaka) (Manjunath Ballur via aajisaka)
HDFS-9839. Reduce verbosity of processReport logging. (Arpit Agarwal)
Release 2.7.3 - UNRELEASED Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1825,7 +1825,7 @@ public boolean processReport(final DatanodeID nodeID,
final long startTime = Time.monotonicNow(); //after acquiring write lock final long startTime = Time.monotonicNow(); //after acquiring write lock
final long endTime; final long endTime;
DatanodeDescriptor node; DatanodeDescriptor node;
Collection<Block> invalidatedBlocks = null; Collection<Block> invalidatedBlocks = Collections.emptyList();
try { try {
node = datanodeManager.getDatanode(nodeID); node = datanodeManager.getDatanode(nodeID);
@ -1900,11 +1900,9 @@ public boolean processReport(final DatanodeID nodeID,
namesystem.writeUnlock(); namesystem.writeUnlock();
} }
if (invalidatedBlocks != null) { for (Block b : invalidatedBlocks) {
for (Block b : invalidatedBlocks) { blockLog.debug("BLOCK* processReport: {} on node {} size {} does not " +
blockLog.info("BLOCK* processReport: {} on node {} size {} does not " + "belong to any file", b, node, b.getNumBytes());
"belong to any file", b, node, b.getNumBytes());
}
} }
// Log the block report processing stats from Namenode perspective // Log the block report processing stats from Namenode perspective
@ -1913,9 +1911,11 @@ public boolean processReport(final DatanodeID nodeID,
metrics.addBlockReport((int) (endTime - startTime)); metrics.addBlockReport((int) (endTime - startTime));
} }
blockLog.info("BLOCK* processReport: from storage {} node {}, " + blockLog.info("BLOCK* processReport: from storage {} node {}, " +
"blocks: {}, hasStaleStorage: {}, processing time: {} msecs", storage "blocks: {}, hasStaleStorage: {}, processing time: {} msecs, " +
.getStorageID(), nodeID, newReport.getNumberOfBlocks(), "invalidatedBlocks: {}", storage.getStorageID(), nodeID,
node.hasStaleStorages(), (endTime - startTime)); newReport.getNumberOfBlocks(),
node.hasStaleStorages(), (endTime - startTime),
invalidatedBlocks.size());
return !node.hasStaleStorages(); return !node.hasStaleStorages();
} }