|
@@ -874,7 +874,7 @@ public class BlockManager {
|
|
|
final DatanodeStorageInfo[] storages = uc.getExpectedStorageLocations();
|
|
|
final ExtendedBlock eb = new ExtendedBlock(namesystem.getBlockPoolId(),
|
|
|
blk);
|
|
|
- return new LocatedStripedBlock(eb, storages, uc.getBlockIndices(), pos,
|
|
|
+ return newLocatedStripedBlock(eb, storages, uc.getBlockIndices(), pos,
|
|
|
false);
|
|
|
} else {
|
|
|
assert blk instanceof BlockInfoContiguousUnderConstruction;
|
|
@@ -883,13 +883,8 @@ public class BlockManager {
|
|
|
final DatanodeStorageInfo[] storages = uc.getExpectedStorageLocations();
|
|
|
final ExtendedBlock eb = new ExtendedBlock(namesystem.getBlockPoolId(),
|
|
|
blk);
|
|
|
- return new LocatedBlock(eb, storages, pos, false);
|
|
|
+ return newLocatedBlock(eb, storages, pos, false);
|
|
|
}
|
|
|
- final BlockInfoContiguousUnderConstruction uc =
|
|
|
- (BlockInfoContiguousUnderConstruction) blk;
|
|
|
- final DatanodeStorageInfo[] storages = uc.getExpectedStorageLocations();
|
|
|
- final ExtendedBlock eb = new ExtendedBlock(namesystem.getBlockPoolId(), blk);
|
|
|
- return newLocatedBlock(eb, storages, pos, false);
|
|
|
}
|
|
|
|
|
|
// get block locations
|
|
@@ -932,7 +927,7 @@ public class BlockManager {
|
|
|
final ExtendedBlock eb = new ExtendedBlock(namesystem.getBlockPoolId(), blk);
|
|
|
return blockIndices == null ?
|
|
|
newLocatedBlock(eb, machines, pos, isCorrupt) :
|
|
|
- new LocatedStripedBlock(eb, machines, blockIndices, pos, isCorrupt);
|
|
|
+ newLocatedStripedBlock(eb, machines, blockIndices, pos, isCorrupt);
|
|
|
}
|
|
|
|
|
|
/** Create a LocatedBlocks. */
|
|
@@ -3514,7 +3509,7 @@ public class BlockManager {
|
|
|
if (pendingReplicationBlocksCount == 0 &&
|
|
|
underReplicatedBlocksCount == 0) {
|
|
|
LOG.info("Node {} is dead and there are no under-replicated" +
|
|
|
- " blocks or blocks pending replication. Safe to decommission.",
|
|
|
+ " blocks or blocks pending replication. Safe to decommission.",
|
|
|
node);
|
|
|
return true;
|
|
|
}
|
|
@@ -3920,6 +3915,18 @@ public class BlockManager {
|
|
|
null);
|
|
|
}
|
|
|
|
|
|
+ public static LocatedStripedBlock newLocatedStripedBlock(
|
|
|
+ ExtendedBlock b, DatanodeStorageInfo[] storages,
|
|
|
+ int[] indices, long startOffset, boolean corrupt) {
|
|
|
+ // startOffset is unknown
|
|
|
+ return new LocatedStripedBlock(
|
|
|
+ b, DatanodeStorageInfo.toDatanodeInfos(storages),
|
|
|
+ DatanodeStorageInfo.toStorageIDs(storages),
|
|
|
+ DatanodeStorageInfo.toStorageTypes(storages),
|
|
|
+ indices, startOffset, corrupt,
|
|
|
+ null);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* This class is used internally by {@link this#computeRecoveryWorkForBlocks}
|
|
|
* to represent a task to recover a block through replication or erasure
|