Skip to content

Commit 72b7601

Browse files
authored
HDFS-16893. Standardize the usage of DFSClient debug log (#5303)
Co-authored-by: Zhtttylz <[email protected]> Reviewed-by: Ayush Saxena <[email protected]> Signed-off-by: Shilun Fan <[email protected]>
1 parent 04f3573 commit 72b7601

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,7 @@ private void flipDataBuffers() {
293293
DataChecksum checksum, String[] favoredNodes)
294294
throws IOException {
295295
super(dfsClient, src, stat, flag, progress, checksum, favoredNodes, false);
296-
if (LOG.isDebugEnabled()) {
297-
LOG.debug("Creating DFSStripedOutputStream for " + src);
298-
}
296+
LOG.debug("Creating DFSStripedOutputStream for {}", src);
299297

300298
ecPolicy = stat.getErasureCodingPolicy();
301299
final int numParityBlocks = ecPolicy.getNumParityUnits();

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,12 @@ public static void cloneDelegationTokenForLogicalUri(
135135
HdfsConstants.HDFS_URI_SCHEME)
136136
+ "//" + specificToken.getService());
137137
ugi.addToken(alias, specificToken);
138-
if (LOG.isDebugEnabled()) {
139-
LOG.debug("Mapped HA service delegation token for logical URI " +
140-
haUri + " to namenode " + singleNNAddr);
141-
}
138+
LOG.debug("Mapped HA service delegation token for logical URI {}" +
139+
" to namenode {}", haUri, singleNNAddr);
142140
}
143141
} else {
144-
if (LOG.isDebugEnabled()) {
145-
LOG.debug("No HA service delegation token found for logical URI " +
146-
haUri);
147-
}
142+
LOG.debug("No HA service delegation token found for logical URI {}",
143+
haUri);
148144
}
149145
}
150146
}

hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/hdfs/util/TestByteArrayManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public void run() {
342342
}
343343

344344
if ((i & 0xFF) == 0) {
345-
LOG.info("randomRecycler sleep, i=" + i);
345+
LOG.info("randomRecycler sleep, i={}", i);
346346
sleepMs(100);
347347
}
348348
}

0 commit comments

Comments
 (0)