HDFS-8167. BlockManager.addBlockCollectionWithCheck should check if the block is a striped block. Contributed by Hui Zheng.
This commit is contained in:
parent
4c039b0876
commit
64f8f0a145
|
@ -85,3 +85,5 @@
|
||||||
|
|
||||||
HDFS-7994. Detect if resevered EC Block ID is already used during namenode
|
HDFS-7994. Detect if resevered EC Block ID is already used during namenode
|
||||||
startup. (Hui Zheng via szetszwo)
|
startup. (Hui Zheng via szetszwo)
|
||||||
|
|
||||||
|
HDFS-8167. BlockManager.addBlockCollectionWithCheck should check if the block is a striped block. (Hui Zheng via zhz).
|
||||||
|
|
|
@ -2946,15 +2946,6 @@ public class BlockManager {
|
||||||
return hasNonEcBlockUsingStripedID;
|
return hasNonEcBlockUsingStripedID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of whether there are any non-EC blocks using StripedID.
|
|
||||||
*
|
|
||||||
* @param has - the value of whether there are any non-EC blocks using StripedID.
|
|
||||||
*/
|
|
||||||
public void hasNonEcBlockUsingStripedID(boolean has){
|
|
||||||
hasNonEcBlockUsingStripedID = has;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process a single possibly misreplicated block. This adds it to the
|
* Process a single possibly misreplicated block. This adds it to the
|
||||||
* appropriate queues if necessary, and returns a result code indicating
|
* appropriate queues if necessary, and returns a result code indicating
|
||||||
|
@ -3562,7 +3553,7 @@ public class BlockManager {
|
||||||
if (BlockIdManager.isStripedBlockID(block.getBlockId())) {
|
if (BlockIdManager.isStripedBlockID(block.getBlockId())) {
|
||||||
info = blocksMap.getStoredBlock(
|
info = blocksMap.getStoredBlock(
|
||||||
new Block(BlockIdManager.convertToStripedID(block.getBlockId())));
|
new Block(BlockIdManager.convertToStripedID(block.getBlockId())));
|
||||||
if ((info == null) && hasNonEcBlockUsingStripedID()){
|
if ((info == null) && hasNonEcBlockUsingStripedID){
|
||||||
info = blocksMap.getStoredBlock(block);
|
info = blocksMap.getStoredBlock(block);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -3746,10 +3737,9 @@ public class BlockManager {
|
||||||
*/
|
*/
|
||||||
public BlockInfo addBlockCollectionWithCheck(
|
public BlockInfo addBlockCollectionWithCheck(
|
||||||
BlockInfo block, BlockCollection bc) {
|
BlockInfo block, BlockCollection bc) {
|
||||||
if (!hasNonEcBlockUsingStripedID()){
|
if (!hasNonEcBlockUsingStripedID && !block.isStriped() &&
|
||||||
if (BlockIdManager.isStripedBlockID(block.getBlockId())) {
|
BlockIdManager.isStripedBlockID(block.getBlockId())) {
|
||||||
hasNonEcBlockUsingStripedID(true);
|
hasNonEcBlockUsingStripedID = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return addBlockCollection(block, bc);
|
return addBlockCollection(block, bc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue