HDFS-16153. Avoid evaluation of LOG.debug statement in QuorumJournalManager (#3269). Contributed by wangzhaohui.

(cherry picked from commit a73b64f86b)
This commit is contained in:
wangzhaohui 2021-08-06 16:27:05 +08:00 committed by S O'Donnell
parent b3077543cf
commit e9ba4f4591

View File

@ -586,7 +586,7 @@ private void selectRpcInputStreams(Collection<EditLogInputStream> streams,
responseCounts.get(responseCounts.size() - loggers.getMajoritySize()); responseCounts.get(responseCounts.size() - loggers.getMajoritySize());
if (maxAllowedTxns == 0) { if (maxAllowedTxns == 0) {
LOG.debug("No new edits available in logs; requested starting from " + LOG.debug("No new edits available in logs; requested starting from " +
"ID " + fromTxnId); "ID {}", fromTxnId);
return; return;
} }
LogAction logAction = selectInputStreamLogHelper.record(fromTxnId); LogAction logAction = selectInputStreamLogHelper.record(fromTxnId);
@ -618,9 +618,10 @@ private void selectStreamingInputStreams(
Map<AsyncLogger, RemoteEditLogManifest> resps = Map<AsyncLogger, RemoteEditLogManifest> resps =
loggers.waitForWriteQuorum(q, selectInputStreamsTimeoutMs, loggers.waitForWriteQuorum(q, selectInputStreamsTimeoutMs,
"selectStreamingInputStreams"); "selectStreamingInputStreams");
if (LOG.isDebugEnabled()) {
LOG.debug("selectStreamingInputStream manifests:\n" + LOG.debug("selectStreamingInputStream manifests:\n {}",
Joiner.on("\n").withKeyValueSeparator(": ").join(resps)); Joiner.on("\n").withKeyValueSeparator(": ").join(resps));
}
final PriorityQueue<EditLogInputStream> allStreams = final PriorityQueue<EditLogInputStream> allStreams =
new PriorityQueue<EditLogInputStream>(64, new PriorityQueue<EditLogInputStream>(64,