goiri commented on code in PR #4529:
URL: https://github.com/apache/hadoop/pull/4529#discussion_r914083773
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java:
##########
@@ -522,9 +522,11 @@ protected Node chooseRandom(final String scope, String
excludedScope,
}
}
if (numOfDatanodes <= 0) {
- LOG.debug("Failed to find datanode (scope=\"{}\" excludedScope=\"{}\")."
- + " numOfDatanodes={}",
- scope, excludedScope, numOfDatanodes);
+ if (LOG.isDebugEnabled()) {
Review Comment:
Are we saving anything by checking LOG.isDebugEnabled()? Using {} should
avoid toString() and all.
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java:
##########
@@ -539,10 +541,12 @@ protected Node chooseRandom(final String scope, String
excludedScope,
netlock.readLock().unlock();
}
}
- LOG.debug("Choosing random from {} available nodes on node {},"
- + " scope={}, excludedScope={}, excludeNodes={}. numOfDatanodes={}.",
- availableNodes, innerNode, scope, excludedScope, excludedNodes,
- numOfDatanodes);
+ if (LOG.isDebugEnabled()) {
Review Comment:
What are we saving by doing this?
The + should be statically handled by the compiler.
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java:
##########
@@ -2319,8 +2322,10 @@ public void setErasureCodingPolicy(String src, String
ecPolicyName)
try {
if (ecPolicyName == null) {
ecPolicyName = defaultECPolicyName;
- LOG.debug("No policy name is specified, " +
- "set the default policy name instead");
+ if (LOG.isDebugEnabled()) {
Review Comment:
I don't think we need this check.
With the new style line limit this could fit in one line too.
--
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]