use of org.smartdata.hdfs.action.move.DBlockStriped in project SSM by Intel-bigdata.
the class CompatibilityHelper31 method newDBlock.
@Override
public DBlock newDBlock(LocatedBlock lb, HdfsFileStatus status) {
Block blk = lb.getBlock().getLocalBlock();
ErasureCodingPolicy ecPolicy = status.getErasureCodingPolicy();
DBlock db;
if (lb.isStriped()) {
LocatedStripedBlock lsb = (LocatedStripedBlock) lb;
byte[] indices = new byte[lsb.getBlockIndices().length];
for (int i = 0; i < indices.length; i++) {
indices[i] = (byte) lsb.getBlockIndices()[i];
}
db = (DBlock) new DBlockStriped(blk, indices, (short) ecPolicy.getNumDataUnits(), ecPolicy.getCellSize());
} else {
db = new DBlock(blk);
}
return db;
}
Aggregations