Skip to content

Commit a73b64f

Browse files
authored
HDFS-16153. Avoid evaluation of LOG.debug statement in QuorumJournalManager (#3269). Contributed by wangzhaohui.
1 parent 9fe1f24 commit a73b64f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ private void selectRpcInputStreams(Collection<EditLogInputStream> streams,
586586
responseCounts.get(responseCounts.size() - loggers.getMajoritySize());
587587
if (maxAllowedTxns == 0) {
588588
LOG.debug("No new edits available in logs; requested starting from " +
589-
"ID " + fromTxnId);
589+
"ID {}", fromTxnId);
590590
return;
591591
}
592592
LogAction logAction = selectInputStreamLogHelper.record(fromTxnId);
@@ -618,9 +618,10 @@ private void selectStreamingInputStreams(
618618
Map<AsyncLogger, RemoteEditLogManifest> resps =
619619
loggers.waitForWriteQuorum(q, selectInputStreamsTimeoutMs,
620620
"selectStreamingInputStreams");
621-
622-
LOG.debug("selectStreamingInputStream manifests:\n" +
623-
Joiner.on("\n").withKeyValueSeparator(": ").join(resps));
621+
if (LOG.isDebugEnabled()) {
622+
LOG.debug("selectStreamingInputStream manifests:\n {}",
623+
Joiner.on("\n").withKeyValueSeparator(": ").join(resps));
624+
}
624625

625626
final PriorityQueue<EditLogInputStream> allStreams =
626627
new PriorityQueue<EditLogInputStream>(64,

0 commit comments

Comments
 (0)