Java 类org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.BlockIdCommandProto 实例源码

项目:hadoop    文件:PBHelper.java   
public static BlockIdCommandProto convert(BlockIdCommand cmd) {
  BlockIdCommandProto.Builder builder = BlockIdCommandProto.newBuilder()
      .setBlockPoolId(cmd.getBlockPoolId());
  switch (cmd.getAction()) {
  case DatanodeProtocol.DNA_CACHE:
    builder.setAction(BlockIdCommandProto.Action.CACHE);
    break;
  case DatanodeProtocol.DNA_UNCACHE:
    builder.setAction(BlockIdCommandProto.Action.UNCACHE);
    break;
  default:
    throw new AssertionError("Invalid action");
  }
  long[] blockIds = cmd.getBlockIds();
  for (int i = 0; i < blockIds.length; i++) {
    builder.addBlockIds(blockIds[i]);
  }
  return builder.build();
}
项目:hadoop    文件:PBHelper.java   
public static BlockIdCommand convert(BlockIdCommandProto blkIdCmd) {
  int numBlockIds = blkIdCmd.getBlockIdsCount();
  long blockIds[] = new long[numBlockIds];
  for (int i = 0; i < numBlockIds; i++) {
    blockIds[i] = blkIdCmd.getBlockIds(i);
  }
  int action = DatanodeProtocol.DNA_UNKNOWN;
  switch (blkIdCmd.getAction()) {
  case CACHE:
    action = DatanodeProtocol.DNA_CACHE;
    break;
  case UNCACHE:
    action = DatanodeProtocol.DNA_UNCACHE;
    break;
  default:
    throw new AssertionError("Unknown action type: " + blkIdCmd.getAction());
  }
  return new BlockIdCommand(action, blkIdCmd.getBlockPoolId(), blockIds);
}
项目:aliyun-oss-hadoop-fs    文件:PBHelper.java   
public static BlockIdCommandProto convert(BlockIdCommand cmd) {
  BlockIdCommandProto.Builder builder = BlockIdCommandProto.newBuilder()
      .setBlockPoolId(cmd.getBlockPoolId());
  switch (cmd.getAction()) {
  case DatanodeProtocol.DNA_CACHE:
    builder.setAction(BlockIdCommandProto.Action.CACHE);
    break;
  case DatanodeProtocol.DNA_UNCACHE:
    builder.setAction(BlockIdCommandProto.Action.UNCACHE);
    break;
  default:
    throw new AssertionError("Invalid action");
  }
  long[] blockIds = cmd.getBlockIds();
  for (int i = 0; i < blockIds.length; i++) {
    builder.addBlockIds(blockIds[i]);
  }
  return builder.build();
}
项目:aliyun-oss-hadoop-fs    文件:PBHelper.java   
public static BlockIdCommand convert(BlockIdCommandProto blkIdCmd) {
  int numBlockIds = blkIdCmd.getBlockIdsCount();
  long blockIds[] = new long[numBlockIds];
  for (int i = 0; i < numBlockIds; i++) {
    blockIds[i] = blkIdCmd.getBlockIds(i);
  }
  int action = DatanodeProtocol.DNA_UNKNOWN;
  switch (blkIdCmd.getAction()) {
  case CACHE:
    action = DatanodeProtocol.DNA_CACHE;
    break;
  case UNCACHE:
    action = DatanodeProtocol.DNA_UNCACHE;
    break;
  default:
    throw new AssertionError("Unknown action type: " + blkIdCmd.getAction());
  }
  return new BlockIdCommand(action, blkIdCmd.getBlockPoolId(), blockIds);
}
项目:big-c    文件:PBHelper.java   
public static BlockIdCommandProto convert(BlockIdCommand cmd) {
  BlockIdCommandProto.Builder builder = BlockIdCommandProto.newBuilder()
      .setBlockPoolId(cmd.getBlockPoolId());
  switch (cmd.getAction()) {
  case DatanodeProtocol.DNA_CACHE:
    builder.setAction(BlockIdCommandProto.Action.CACHE);
    break;
  case DatanodeProtocol.DNA_UNCACHE:
    builder.setAction(BlockIdCommandProto.Action.UNCACHE);
    break;
  default:
    throw new AssertionError("Invalid action");
  }
  long[] blockIds = cmd.getBlockIds();
  for (int i = 0; i < blockIds.length; i++) {
    builder.addBlockIds(blockIds[i]);
  }
  return builder.build();
}
项目:big-c    文件:PBHelper.java   
public static BlockIdCommand convert(BlockIdCommandProto blkIdCmd) {
  int numBlockIds = blkIdCmd.getBlockIdsCount();
  long blockIds[] = new long[numBlockIds];
  for (int i = 0; i < numBlockIds; i++) {
    blockIds[i] = blkIdCmd.getBlockIds(i);
  }
  int action = DatanodeProtocol.DNA_UNKNOWN;
  switch (blkIdCmd.getAction()) {
  case CACHE:
    action = DatanodeProtocol.DNA_CACHE;
    break;
  case UNCACHE:
    action = DatanodeProtocol.DNA_UNCACHE;
    break;
  default:
    throw new AssertionError("Unknown action type: " + blkIdCmd.getAction());
  }
  return new BlockIdCommand(action, blkIdCmd.getBlockPoolId(), blockIds);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static BlockIdCommandProto convert(BlockIdCommand cmd) {
  BlockIdCommandProto.Builder builder = BlockIdCommandProto.newBuilder()
      .setBlockPoolId(cmd.getBlockPoolId());
  switch (cmd.getAction()) {
  case DatanodeProtocol.DNA_CACHE:
    builder.setAction(BlockIdCommandProto.Action.CACHE);
    break;
  case DatanodeProtocol.DNA_UNCACHE:
    builder.setAction(BlockIdCommandProto.Action.UNCACHE);
    break;
  default:
    throw new AssertionError("Invalid action");
  }
  long[] blockIds = cmd.getBlockIds();
  for (int i = 0; i < blockIds.length; i++) {
    builder.addBlockIds(blockIds[i]);
  }
  return builder.build();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static BlockIdCommand convert(BlockIdCommandProto blkIdCmd) {
  int numBlockIds = blkIdCmd.getBlockIdsCount();
  long blockIds[] = new long[numBlockIds];
  for (int i = 0; i < numBlockIds; i++) {
    blockIds[i] = blkIdCmd.getBlockIds(i);
  }
  int action = DatanodeProtocol.DNA_UNKNOWN;
  switch (blkIdCmd.getAction()) {
  case CACHE:
    action = DatanodeProtocol.DNA_CACHE;
    break;
  case UNCACHE:
    action = DatanodeProtocol.DNA_UNCACHE;
    break;
  default:
    throw new AssertionError("Unknown action type: " + blkIdCmd.getAction());
  }
  return new BlockIdCommand(action, blkIdCmd.getBlockPoolId(), blockIds);
}
项目:FlexMap    文件:PBHelper.java   
public static BlockIdCommandProto convert(BlockIdCommand cmd) {
  BlockIdCommandProto.Builder builder = BlockIdCommandProto.newBuilder()
      .setBlockPoolId(cmd.getBlockPoolId());
  switch (cmd.getAction()) {
  case DatanodeProtocol.DNA_CACHE:
    builder.setAction(BlockIdCommandProto.Action.CACHE);
    break;
  case DatanodeProtocol.DNA_UNCACHE:
    builder.setAction(BlockIdCommandProto.Action.UNCACHE);
    break;
  default:
    throw new AssertionError("Invalid action");
  }
  long[] blockIds = cmd.getBlockIds();
  for (int i = 0; i < blockIds.length; i++) {
    builder.addBlockIds(blockIds[i]);
  }
  return builder.build();
}
项目:FlexMap    文件:PBHelper.java   
public static BlockIdCommand convert(BlockIdCommandProto blkIdCmd) {
  int numBlockIds = blkIdCmd.getBlockIdsCount();
  long blockIds[] = new long[numBlockIds];
  for (int i = 0; i < numBlockIds; i++) {
    blockIds[i] = blkIdCmd.getBlockIds(i);
  }
  int action = DatanodeProtocol.DNA_UNKNOWN;
  switch (blkIdCmd.getAction()) {
  case CACHE:
    action = DatanodeProtocol.DNA_CACHE;
    break;
  case UNCACHE:
    action = DatanodeProtocol.DNA_UNCACHE;
    break;
  default:
    throw new AssertionError("Unknown action type: " + blkIdCmd.getAction());
  }
  return new BlockIdCommand(action, blkIdCmd.getBlockPoolId(), blockIds);
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static BlockIdCommandProto convert(BlockIdCommand cmd) {
  BlockIdCommandProto.Builder builder = BlockIdCommandProto.newBuilder()
      .setBlockPoolId(cmd.getBlockPoolId());
  switch (cmd.getAction()) {
  case DatanodeProtocol.DNA_CACHE:
    builder.setAction(BlockIdCommandProto.Action.CACHE);
    break;
  case DatanodeProtocol.DNA_UNCACHE:
    builder.setAction(BlockIdCommandProto.Action.UNCACHE);
    break;
  default:
    throw new AssertionError("Invalid action");
  }
  long[] blockIds = cmd.getBlockIds();
  for (int i = 0; i < blockIds.length; i++) {
    builder.addBlockIds(blockIds[i]);
  }
  return builder.build();
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static BlockIdCommand convert(BlockIdCommandProto blkIdCmd) {
  int numBlockIds = blkIdCmd.getBlockIdsCount();
  long blockIds[] = new long[numBlockIds];
  for (int i = 0; i < numBlockIds; i++) {
    blockIds[i] = blkIdCmd.getBlockIds(i);
  }
  int action = DatanodeProtocol.DNA_UNKNOWN;
  switch (blkIdCmd.getAction()) {
  case CACHE:
    action = DatanodeProtocol.DNA_CACHE;
    break;
  case UNCACHE:
    action = DatanodeProtocol.DNA_UNCACHE;
    break;
  default:
    throw new AssertionError("Unknown action type: " + blkIdCmd.getAction());
  }
  return new BlockIdCommand(action, blkIdCmd.getBlockPoolId(), blockIds);
}