public StripedBlockWithLocations(BlockWithLocations blk, byte[] indices, short dataBlockNum, int cellSize) { super(blk.getBlock(), blk.getDatanodeUuids(), blk.getStorageIDs(), blk.getStorageTypes()); Preconditions.checkArgument( blk.getDatanodeUuids().length == indices.length); this.indices = indices; this.dataBlockNum = dataBlockNum; this.cellSize = cellSize; }
for (BlockWithLocations blkLocs : newBlksLocs.getBlocks()) { if (blkLocs.getBlock().getNumBytes() < getBlocksMinBlockSize) { continue; sblkLocs.getDataBlockNum(), sblkLocs.getCellSize()); } else { bytesReceived += blkLocs.getBlock().getNumBytes(); block = new DBlock(blkLocs.getBlock()); block = globalBlocks.putIfAbsent(blkLocs.getBlock(), block); synchronized (block) { block.clearLocations();
public static BlockWithLocationsProto convert(BlockWithLocations blk) { BlockWithLocationsProto.Builder builder = BlockWithLocationsProto .newBuilder().setBlock(PBHelperClient.convert(blk.getBlock())) .addAllDatanodeUuids(Arrays.asList(blk.getDatanodeUuids())) .addAllStorageUuids(Arrays.asList(blk.getStorageIDs())) .addAllStorageTypes(PBHelperClient.convertStorageTypes(blk.getStorageTypes())); if (blk instanceof StripedBlockWithLocations) { StripedBlockWithLocations sblk = (StripedBlockWithLocations) blk; builder.setIndices(PBHelperClient.getByteString(sblk.getIndices())); builder.setDataBlockNum(sblk.getDataBlockNum()); builder.setCellSize(sblk.getCellSize()); } return builder.build(); }
for (BlockWithLocations blk : newBlocks.getBlocks()) { if (blk.getBlock().getNumBytes() < getBlocksMinBlockSize) { continue; bytesReceived += blk.getBlock().getNumBytes(); synchronized (globalBlocks) { final DBlock block = globalBlocks.get(blk.getBlock()); synchronized (block) { block.clearLocations();
for (BlockWithLocations blk : newBlocks.getBlocks()) { if (blk.getBlock().getNumBytes() < getBlocksMinBlockSize) { continue; bytesReceived += blk.getBlock().getNumBytes(); synchronized (globalBlocks) { final DBlock block = globalBlocks.get(blk.getBlock()); synchronized (block) { block.clearLocations();
long bytesReceived = 0; for (BlockWithLocations blk : newBlocks) { bytesReceived += blk.getBlock().getNumBytes(); BalancerBlock block; synchronized(globalBlockList) { block = globalBlockList.get(blk.getBlock()); if (block==null) { block = new BalancerBlock(blk.getBlock()); globalBlockList.put(blk.getBlock(), block); } else { block.clearLocations();
long bytesReceived = 0; for (BlockWithLocations blk : newBlocks) { bytesReceived += blk.getBlock().getNumBytes(); BalancerBlock block; synchronized(globalBlockList) { block = globalBlockList.get(blk.getBlock()); if (block==null) { block = new BalancerBlock(blk.getBlock()); globalBlockList.put(blk.getBlock(), block); } else { block.clearLocations();
public static BlockWithLocationsProto convert(BlockWithLocations blk) { return BlockWithLocationsProto.newBuilder() .setBlock(convert(blk.getBlock())) .addAllDatanodeUuids(Arrays.asList(blk.getDatanodeUuids())) .addAllStorageUuids(Arrays.asList(blk.getStorageIDs())) .addAllStorageTypes(convertStorageTypes(blk.getStorageTypes())) .build(); }
public static BlockWithLocationsProto convert(BlockWithLocations blk) { return BlockWithLocationsProto.newBuilder() .setBlock(convert(blk.getBlock())) .addAllDatanodeUuids(Arrays.asList(blk.getDatanodeUuids())) .addAllStorageUuids(Arrays.asList(blk.getStorageIDs())) .addAllStorageTypes(convertStorageTypes(blk.getStorageTypes())) .build(); }