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;
|
package org.apache.hadoop.hdfs.server.blockmanagement;
|
||||||
|
|
||||||
import org.apache.hadoop.net.Node;
|
import org.apache.hadoop.net.Node;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -30,6 +32,10 @@
|
|||||||
* Reconstruction is done by transferring data from srcNodes to targets
|
* Reconstruction is done by transferring data from srcNodes to targets
|
||||||
*/
|
*/
|
||||||
abstract class BlockReconstructionWork {
|
abstract class BlockReconstructionWork {
|
||||||
|
|
||||||
|
public static final Logger LOG =
|
||||||
|
LoggerFactory.getLogger(BlockReconstructionWork.class);
|
||||||
|
|
||||||
private final BlockInfo block;
|
private final BlockInfo block;
|
||||||
|
|
||||||
private final String srcPath;
|
private final String srcPath;
|
||||||
|
@ -44,7 +44,7 @@ public ErasureCodingWork(String blockPoolId, BlockInfo block,
|
|||||||
liveReplicaStorages, additionalReplRequired, priority);
|
liveReplicaStorages, additionalReplRequired, priority);
|
||||||
this.blockPoolId = blockPoolId;
|
this.blockPoolId = blockPoolId;
|
||||||
this.liveBlockIndicies = liveBlockIndicies;
|
this.liveBlockIndicies = liveBlockIndicies;
|
||||||
BlockManager.LOG.debug("Creating an ErasureCodingWork to {} reconstruct ",
|
LOG.debug("Creating an ErasureCodingWork to {} reconstruct ",
|
||||||
block);
|
block);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,10 +157,8 @@ private void createReplicationWork(int sourceIndex,
|
|||||||
internBlkLen, stripedBlk.getGenerationStamp());
|
internBlkLen, stripedBlk.getGenerationStamp());
|
||||||
source.addBlockToBeReplicated(targetBlk,
|
source.addBlockToBeReplicated(targetBlk,
|
||||||
new DatanodeStorageInfo[] {target});
|
new DatanodeStorageInfo[] {target});
|
||||||
if (BlockManager.LOG.isDebugEnabled()) {
|
LOG.debug("Add replication task from source {} to "
|
||||||
BlockManager.LOG.debug("Add replication task from source {} to "
|
+ "target {} for EC block {}", source, target, targetBlk);
|
||||||
+ "target {} for EC block {}", source, target, targetBlk);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Integer> findLeavingServiceSources() {
|
private List<Integer> findLeavingServiceSources() {
|
||||||
|
@ -32,8 +32,7 @@ public ReplicationWork(BlockInfo block, BlockCollection bc,
|
|||||||
assert getSrcNodes().length == 1 :
|
assert getSrcNodes().length == 1 :
|
||||||
"There should be exactly 1 source node that have been selected";
|
"There should be exactly 1 source node that have been selected";
|
||||||
getSrcNodes()[0].incrementPendingReplicationWithoutTargets();
|
getSrcNodes()[0].incrementPendingReplicationWithoutTargets();
|
||||||
BlockManager.LOG
|
LOG.debug("Creating a ReplicationWork to reconstruct " + block);
|
||||||
.debug("Creating a ReplicationWork to reconstruct " + block);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user