Search in sources :

Example 1 with DBlockStriped

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;
}
Also used : DBlock(org.smartdata.hdfs.action.move.DBlock) DBlock(org.smartdata.hdfs.action.move.DBlock) DBlockStriped(org.smartdata.hdfs.action.move.DBlockStriped)

Aggregations

DBlock (org.smartdata.hdfs.action.move.DBlock)1 DBlockStriped (org.smartdata.hdfs.action.move.DBlockStriped)1