HDFS-8684. Erasure Coding: fix some block number calculation for striped block. (yliu)
This commit is contained in:
parent
0b7af27b9a
commit
ee01a09500
|
@ -325,4 +325,7 @@
|
|||
multiple times. (Kai Sasaki via szetszwo)
|
||||
|
||||
HDFS-8468. 2 RPC calls for every file read in DFSClient#open(..) resulting in
|
||||
double Audit log entries (vinayakumarb)
|
||||
double Audit log entries (vinayakumarb)
|
||||
|
||||
HDFS-8684. Erasure Coding: fix some block number calculation for striped
|
||||
block. (yliu)
|
||||
|
|
|
@ -3109,12 +3109,12 @@ public class BlockManager {
|
|||
bc.getStoragePolicyID());
|
||||
final List<StorageType> excessTypes = storagePolicy.chooseExcess(
|
||||
replication, DatanodeStorageInfo.toStorageTypes(nonExcess));
|
||||
if (!storedBlock.isStriped()) {
|
||||
chooseExcessReplicasContiguous(bc, nonExcess, storedBlock,
|
||||
replication, addedNode, delNodeHint, excessTypes);
|
||||
} else {
|
||||
if (storedBlock.isStriped()) {
|
||||
chooseExcessReplicasStriped(bc, nonExcess, storedBlock, delNodeHint,
|
||||
excessTypes);
|
||||
} else {
|
||||
chooseExcessReplicasContiguous(bc, nonExcess, storedBlock,
|
||||
replication, addedNode, delNodeHint, excessTypes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3191,9 +3191,6 @@ public class BlockManager {
|
|||
assert storedBlock instanceof BlockInfoStriped;
|
||||
BlockInfoStriped sblk = (BlockInfoStriped) storedBlock;
|
||||
short groupSize = sblk.getTotalBlockNum();
|
||||
if (nonExcess.size() <= groupSize) {
|
||||
return;
|
||||
}
|
||||
BlockPlacementPolicy placementPolicy = placementPolicies.getPolicy(true);
|
||||
List<DatanodeStorageInfo> empty = new ArrayList<>(0);
|
||||
|
||||
|
|
|
@ -809,13 +809,9 @@ public class INodeFile extends INodeWithAdditionalFields
|
|||
if (!includesLastUcBlock) {
|
||||
size = 0;
|
||||
} else if (usePreferredBlockSize4LastUcBlock) {
|
||||
// Striped blocks keeps block group which counts
|
||||
// (data blocks num + parity blocks num). When you
|
||||
// count actual used size by BlockInfoStripedUC must
|
||||
// be multiplied by these blocks number.
|
||||
BlockInfoStripedUnderConstruction blockInfoStripedUC
|
||||
= (BlockInfoStripedUnderConstruction) blockInfos[last];
|
||||
size = getPreferredBlockSize() * blockInfoStripedUC.getTotalBlockNum();
|
||||
size = getPreferredBlockSize() * blockInfoStripedUC.getDataBlockNum();
|
||||
}
|
||||
}
|
||||
//sum other blocks
|
||||
|
|
Loading…
Reference in New Issue