goiri commented on code in PR #4529:
URL: https://github.com/apache/hadoop/pull/4529#discussion_r915161873
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java:
##########
@@ -4203,8 +4211,10 @@ public void removeStoredBlock(BlockInfo storedBlock,
DatanodeDescriptor node) {
assert (namesystem.hasWriteLock());
{
if (storedBlock == null || !blocksMap.removeNode(storedBlock, node)) {
- blockLog.debug("BLOCK* removeStoredBlock: {} has already been" +
- " removed from node {}", storedBlock, node);
+ if (blockLog.isDebugEnabled()) {
+ blockLog.debug("BLOCK* removeStoredBlock: {} has already been" +
Review Comment:
With the new checkstyle, the string fits in one line without splitting:
```
blockLog.debug("BLOCK* removeStoredBlock: {} has already been removed from
node {}",
storedBlock, node);
```
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java:
##########
@@ -238,8 +238,10 @@ DatanodeStorageInfo[] chooseTarget(String src,
return getPipeline(writer,
results.toArray(new DatanodeStorageInfo[results.size()]));
} catch (NotEnoughReplicasException nr) {
- LOG.debug("Failed to choose with favored nodes (={}), disregard favored"
- + " nodes hint and retry.", favoredNodes, nr);
+ if (LOG.isDebugEnabled()) {
Review Comment:
The string fits in one line if you do:
```
LOG.debug(
"Failed to choose with favored nodes (={}), disregard favored nodes hint
and retry.",
favoredNodes, nr);
```
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java:
##########
@@ -745,9 +749,12 @@ private DatanodeStorageInfo chooseFromNextRack(Node next,
return chooseRandom(nextRack, excludedNodes, blocksize, maxNodesPerRack,
results, avoidStaleNodes, storageTypes);
} catch (NotEnoughReplicasException e) {
- LOG.debug("Failed to choose from the next rack (location = {}), "
- + "retry choosing randomly", nextRack, e);
- // otherwise randomly choose one from the network
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Failed to choose from the next rack (location = {}), "
Review Comment:
The string fits in one line.
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java:
##########
@@ -1003,9 +1005,11 @@ public final void processCacheReport(final DatanodeID
datanodeID,
if (metrics != null) {
metrics.addCacheBlockReport((int) (endTime - startTime));
}
- LOG.debug("Processed cache report from {}, blocks: {}, " +
- "processing time: {} msecs", datanodeID, blockIds.size(),
- (endTime - startTime));
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Processed cache report from {}, blocks: {}, " +
Review Comment:
The string fits in one line.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]