|
@@ -1872,7 +1872,7 @@ public class BlockManager {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- BlockInfoContiguous bi = blocksMap.getStoredBlock(b);
|
|
|
|
|
|
+ BlockInfoContiguous bi = getStoredBlock(b);
|
|
if (bi == null) {
|
|
if (bi == null) {
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
LOG.debug("BLOCK* rescanPostponedMisreplicatedBlocks: " +
|
|
LOG.debug("BLOCK* rescanPostponedMisreplicatedBlocks: " +
|
|
@@ -1977,7 +1977,7 @@ public class BlockManager {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
- BlockInfoContiguous storedBlock = blocksMap.getStoredBlock(iblk);
|
|
|
|
|
|
+ BlockInfoContiguous storedBlock = getStoredBlock(iblk);
|
|
// If block does not belong to any file, we are done.
|
|
// If block does not belong to any file, we are done.
|
|
if (storedBlock == null) continue;
|
|
if (storedBlock == null) continue;
|
|
|
|
|
|
@@ -2119,7 +2119,7 @@ public class BlockManager {
|
|
}
|
|
}
|
|
|
|
|
|
// find block by blockId
|
|
// find block by blockId
|
|
- BlockInfoContiguous storedBlock = blocksMap.getStoredBlock(block);
|
|
|
|
|
|
+ BlockInfoContiguous storedBlock = getStoredBlock(block);
|
|
if(storedBlock == null) {
|
|
if(storedBlock == null) {
|
|
// If blocksMap does not contain reported block id,
|
|
// If blocksMap does not contain reported block id,
|
|
// the replica should be removed from the data-node.
|
|
// the replica should be removed from the data-node.
|
|
@@ -2410,7 +2410,7 @@ public class BlockManager {
|
|
DatanodeDescriptor node = storageInfo.getDatanodeDescriptor();
|
|
DatanodeDescriptor node = storageInfo.getDatanodeDescriptor();
|
|
if (block instanceof BlockInfoContiguousUnderConstruction) {
|
|
if (block instanceof BlockInfoContiguousUnderConstruction) {
|
|
//refresh our copy in case the block got completed in another thread
|
|
//refresh our copy in case the block got completed in another thread
|
|
- storedBlock = blocksMap.getStoredBlock(block);
|
|
|
|
|
|
+ storedBlock = getStoredBlock(block);
|
|
} else {
|
|
} else {
|
|
storedBlock = block;
|
|
storedBlock = block;
|
|
}
|
|
}
|
|
@@ -3356,7 +3356,15 @@ public class BlockManager {
|
|
}
|
|
}
|
|
|
|
|
|
public BlockInfoContiguous getStoredBlock(Block block) {
|
|
public BlockInfoContiguous getStoredBlock(Block block) {
|
|
- return blocksMap.getStoredBlock(block);
|
|
|
|
|
|
+ BlockInfoContiguous info = null;
|
|
|
|
+ if (BlockIdManager.isStripedBlockID(block.getBlockId())) {
|
|
|
|
+ info = blocksMap.getStoredBlock(
|
|
|
|
+ new Block(BlockIdManager.convertToGroupID(block.getBlockId())));
|
|
|
|
+ }
|
|
|
|
+ if (info == null) {
|
|
|
|
+ info = blocksMap.getStoredBlock(block);
|
|
|
|
+ }
|
|
|
|
+ return info;
|
|
}
|
|
}
|
|
|
|
|
|
/** updates a block in under replication queue */
|
|
/** updates a block in under replication queue */
|