本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.DatanodeDescriptor.BlockTargetPair类的典型用法代码示例。如果您正苦于以下问题:Java BlockTargetPair类的具体用法?Java BlockTargetPair怎么用?Java BlockTargetPair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockTargetPair类属于org.apache.hadoop.hdfs.server.namenode.DatanodeDescriptor包,在下文中一共展示了BlockTargetPair类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BlockCommand
import org.apache.hadoop.hdfs.server.namenode.DatanodeDescriptor.BlockTargetPair; //导入依赖的package包/类
/**
* 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;
}
}
示例2: CumulusRecoveryCommand
import org.apache.hadoop.hdfs.server.namenode.DatanodeDescriptor.BlockTargetPair; //导入依赖的package包/类
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;
}