HDFS-14796. Define LOG instead of BlockManager.LOG in ErasureCodingWork/ReplicationWork. Contributed by Fei Hui.

This commit is contained in:
Surendra Singh Lilhore 2019-08-30 14:28:13 +05:30
parent 22a58615a2
commit 96f7dc1992
3 changed files with 10 additions and 7 deletions

View File

@ -18,6 +18,8 @@
package org.apache.hadoop.hdfs.server.blockmanagement;
import org.apache.hadoop.net.Node;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collections;
import java.util.List;
@ -30,6 +32,10 @@ import java.util.Set;
* Reconstruction is done by transferring data from srcNodes to targets
*/
abstract class BlockReconstructionWork {
public static final Logger LOG =
LoggerFactory.getLogger(BlockReconstructionWork.class);
private final BlockInfo block;
private final String srcPath;

View File

@ -44,7 +44,7 @@ class ErasureCodingWork extends BlockReconstructionWork {
liveReplicaStorages, additionalReplRequired, priority);
this.blockPoolId = blockPoolId;
this.liveBlockIndicies = liveBlockIndicies;
BlockManager.LOG.debug("Creating an ErasureCodingWork to {} reconstruct ",
LOG.debug("Creating an ErasureCodingWork to {} reconstruct ",
block);
}
@ -157,10 +157,8 @@ class ErasureCodingWork extends BlockReconstructionWork {
internBlkLen, stripedBlk.getGenerationStamp());
source.addBlockToBeReplicated(targetBlk,
new DatanodeStorageInfo[] {target});
if (BlockManager.LOG.isDebugEnabled()) {
BlockManager.LOG.debug("Add replication task from source {} to "
+ "target {} for EC block {}", source, target, targetBlk);
}
LOG.debug("Add replication task from source {} to "
+ "target {} for EC block {}", source, target, targetBlk);
}
private List<Integer> findLeavingServiceSources() {

View File

@ -32,8 +32,7 @@ class ReplicationWork extends BlockReconstructionWork {
assert getSrcNodes().length == 1 :
"There should be exactly 1 source node that have been selected";
getSrcNodes()[0].incrementPendingReplicationWithoutTargets();
BlockManager.LOG
.debug("Creating a ReplicationWork to reconstruct " + block);
LOG.debug("Creating a ReplicationWork to reconstruct " + block);
}
@Override