HDFS-15425. Review Logging of DFSClient. Contributed by Hongbing Wang.

This commit is contained in:
He Xiaoqiao 2020-07-07 13:01:46 +08:00
parent 2bbd00dff4
commit 4f26454a7d
3 changed files with 9 additions and 18 deletions

View File

@ -332,12 +332,9 @@ public DFSClient(URI nameNodeUri, ClientProtocol rpcNamenode,
MIN_REPLICATION,
HdfsClientConfigKeys.BlockWrite.ReplaceDatanodeOnFailure.
MIN_REPLICATION_DEFAULT);
if (LOG.isDebugEnabled()) {
LOG.debug(
"Sets " + HdfsClientConfigKeys.BlockWrite.ReplaceDatanodeOnFailure.
MIN_REPLICATION + " to "
+ dtpReplaceDatanodeOnFailureReplication);
}
LOG.debug("Sets {} to {}",
HdfsClientConfigKeys.BlockWrite.ReplaceDatanodeOnFailure.
MIN_REPLICATION, dtpReplaceDatanodeOnFailureReplication);
this.ugi = UserGroupInformation.getCurrentUser();
this.namenodeUri = nameNodeUri;

View File

@ -110,9 +110,7 @@ public class DFSStripedInputStream extends DFSInputStream {
dataBlkNum, parityBlkNum);
decoder = CodecUtil.createRawDecoder(dfsClient.getConfiguration(),
ecPolicy.getCodecName(), coderOptions);
if (DFSClient.LOG.isDebugEnabled()) {
DFSClient.LOG.debug("Creating an striped input stream for file " + src);
}
DFSClient.LOG.debug("Creating an striped input stream for file {}", src);
}
private boolean useDirectBuffer() {
@ -465,10 +463,8 @@ protected LocatedBlock refreshLocatedBlock(LocatedBlock block)
break;
}
}
if (DFSClient.LOG.isDebugEnabled()) {
DFSClient.LOG.debug("refreshLocatedBlock for striped blocks, offset="
+ block.getStartOffset() + ". Obtained block " + lb + ", idx=" + idx);
}
DFSClient.LOG.debug("refreshLocatedBlock for striped blocks, offset={}." +
" Obtained block {}, idx={}", block.getStartOffset(), lb, idx);
return StripedBlockUtil.constructInternalBlock(
lsb, i, cellSize, dataBlkNum, idx);
}
@ -526,7 +522,7 @@ protected void reportLostBlock(LocatedBlock lostBlock,
if (!warnedNodes.containsAll(dnUUIDs)) {
DFSClient.LOG.warn(Arrays.toString(nodes) + " are unavailable and " +
"all striping blocks on them are lost. " +
"IgnoredNodes = " + ignoredNodes);
"IgnoredNodes = {}", ignoredNodes);
warnedNodes.addAll(dnUUIDs);
}
} else {

View File

@ -353,10 +353,8 @@ void readStripe() throws IOException {
StripingChunkReadResult r = StripedBlockUtil
.getNextCompletedStripedRead(service, futures, 0);
dfsStripedInputStream.updateReadStats(r.getReadStats());
if (DFSClient.LOG.isDebugEnabled()) {
DFSClient.LOG.debug("Read task returned: " + r + ", for stripe "
+ alignedStripe);
}
DFSClient.LOG.debug("Read task returned: {}, for stripe {}",
r, alignedStripe);
StripingChunk returnedChunk = alignedStripe.chunks[r.index];
Preconditions.checkNotNull(returnedChunk);
Preconditions.checkState(returnedChunk.state == StripingChunk.PENDING);