You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/08/05 12:05:01 UTC

[GitHub] [hadoop] sodonnel commented on a change in pull request #3269: HDFS-16153. Avoid evaluation of LOG.debug statement in QuorumJournalM…

sodonnel commented on a change in pull request #3269:
URL: https://github.com/apache/hadoop/pull/3269#discussion_r683389821



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java
##########
@@ -585,8 +585,10 @@ private void selectRpcInputStreams(Collection<EditLogInputStream> streams,
     int maxAllowedTxns = !onlyDurableTxns ? highestTxnCount :
         responseCounts.get(responseCounts.size() - loggers.getMajoritySize());
     if (maxAllowedTxns == 0) {
-      LOG.debug("No new edits available in logs; requested starting from " +
-          "ID " + fromTxnId);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("No new edits available in logs; requested starting from " +
+            "ID " + fromTxnId);
+      }

Review comment:
       If would be better to remove the `if (LOG.isDebugEnabled())` and change the log statement to:
   
   ```
   LOG.debug("No new edits available in logs; requested starting from ID {}", fromTxnId);
   ```
   
   This avoids any evaluation and inside the debug method, it checks if debug is enabled or not before evaluating the string.




-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org