/** * Create BlockCommand for transferring blocks to another datanode * @param blocktargetlist blocks to be transferred */ public BlockCommand(int action, List<BlockTargetPair> blocktargetlist) { super(action); blocks = new Block[blocktargetlist.size()]; targets = new DatanodeInfo[blocks.length][]; for(int i = 0; i < blocks.length; i++) { BlockTargetPair p = blocktargetlist.get(i); blocks[i] = p.block; targets[i] = p.targets; } }
public CumulusRecoveryCommand(int action, byte type, byte lostColumn, CodingMatrix matrix, List<BlockTargetPair> blockTargetPairs){ super(action); this.type = type; this.lostColumn = lostColumn; locatedblks = new LocatedBlock[blockTargetPairs.size()]; for(int i = 0; i < locatedblks.length; i++) { BlockTargetPair p = blockTargetPairs.get(i); locatedblks[i]= new LocatedBlock(p.block, p.targets); } this.matrix = matrix; }