HDFS-14796. Define LOG instead of BlockManager.LOG in ErasureCodingWork/ReplicationWork. Contributed by Fei Hui.
This commit is contained in:
parent
22a58615a2
commit
96f7dc1992
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue