datanodeUuids[i], storageTypes[i]); if (g != null) { // not unknown block.addLocation(g);
public DBlock getInternalBlock(StorageGroup storage) { int idxInLocs = locations.indexOf(storage); if (idxInLocs == -1) { return null; } byte idxInGroup = indices[idxInLocs]; long blkId = getBlock().getBlockId() + idxInGroup; long numBytes = getInternalBlockLength(getNumBytes(), cellSize, dataBlockNum, idxInGroup); Block blk = new Block(getBlock()); blk.setBlockId(blkId); blk.setNumBytes(numBytes); DBlock dblk = new DBlock(blk); dblk.addLocation(storage); return dblk; }
datanodeUuids[i], storageTypes[i]); if (g != null) { // not unknown block.addLocation(g);
datanodeUuids[i], storageTypes[i]); if (g != null) { // not unknown block.addLocation(g);
DBlock newDBlock(Block block, List<MLocation> locations) { final DBlock db = new DBlock(block); for(MLocation ml : locations) { StorageGroup source = storages.getSource(ml); if (source != null) { db.addLocation(source); } } return db; }
DBlock newDBlock(Block block, List<MLocation> locations) { final DBlock db = new DBlock(block); for(MLocation ml : locations) { StorageGroup source = storages.getSource(ml); if (source != null) { db.addLocation(source); } } return db; }
DBlock newDBlock(LocatedBlock lb, List<MLocation> locations, ErasureCodingPolicy ecPolicy) { Block blk = lb.getBlock().getLocalBlock(); 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 = new DBlockStriped(blk, indices, (short) ecPolicy.getNumDataUnits(), ecPolicy.getCellSize()); } else { db = new DBlock(blk); } for(MLocation ml : locations) { StorageGroup source = storages.getSource(ml); if (source != null) { db.addLocation(source); } } return db; }