Java 类org.apache.hadoop.hdfs.server.protocol.ReceivedDeletedBlockInfo.BlockStatus 实例源码

项目:hadoop    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelper.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:aliyun-oss-hadoop-fs    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelperClient.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:aliyun-oss-hadoop-fs    文件:TestIncrementalBrVariations.java   
/**
 * Verify that the NameNode can learn about new storages from incremental
 * block reports.
 * This tests the fix for the error condition seen in HDFS-6904.
 *
 * @throws IOException
 * @throws InterruptedException
 */
@Test (timeout=60000)
public void testNnLearnsNewStorages()
    throws IOException, InterruptedException {

  // Generate a report for a fake block on a fake storage.
  final String newStorageUuid = UUID.randomUUID().toString();
  final DatanodeStorage newStorage = new DatanodeStorage(newStorageUuid);
  StorageReceivedDeletedBlocks[] reports = DFSTestUtil.
      makeReportForReceivedBlock(getDummyBlock(), BlockStatus.RECEIVED_BLOCK,
          newStorage);

  // Send the report to the NN.
  cluster.getNameNodeRpc().blockReceivedAndDeleted(dn0Reg, poolId, reports);
  // IBRs are async, make sure the NN processes all of them.
  cluster.getNamesystem().getBlockManager().flushBlockOps();
  // Make sure that the NN has learned of the new storage.
  DatanodeStorageInfo storageInfo = cluster.getNameNode()
                                           .getNamesystem()
                                           .getBlockManager()
                                           .getDatanodeManager()
                                           .getDatanode(dn0.getDatanodeId())
                                           .getStorageInfo(newStorageUuid);
  assertNotNull(storageInfo);
}
项目:big-c    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelper.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelper.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:hadoop-plus    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelper.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:FlexMap    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelper.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:hops    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
    case CREATING:
      status = BlockStatus.CREATING;
      break;
    case APPENDING:
      status = BlockStatus.APPENDING;
      break;
    case RECOVERING_APPEND:
      status = BlockStatus.RECOVERING_APPEND;
      break;
    case RECEIVED:
      status = BlockStatus.RECEIVED;
      break;
    case UPDATE_RECOVERED:
      status = BlockStatus.UPDATE_RECOVERED;
      break;
    case DELETED:
      status = BlockStatus.DELETED;
      break;
  }
  return new ReceivedDeletedBlockInfo(PBHelper.convert(proto.getBlock()),
      status, proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:hadoop-TCP    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelper.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:hardfs    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelper.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static ReceivedDeletedBlockInfo convert(
    ReceivedDeletedBlockInfoProto proto) {
  ReceivedDeletedBlockInfo.BlockStatus status = null;
  switch (proto.getStatus()) {
  case RECEIVING:
    status = BlockStatus.RECEIVING_BLOCK;
    break;
  case RECEIVED:
    status = BlockStatus.RECEIVED_BLOCK;
    break;
  case DELETED:
    status = BlockStatus.DELETED_BLOCK;
    break;
  }
  return new ReceivedDeletedBlockInfo(
      PBHelper.convert(proto.getBlock()),
      status,
      proto.hasDeleteHint() ? proto.getDeleteHint() : null);
}
项目:hadoop    文件:BPOfferService.java   
void notifyNamenodeReceivedBlock(
    ExtendedBlock block, String delHint, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
      block.getLocalBlock(),
      ReceivedDeletedBlockInfo.BlockStatus.RECEIVED_BLOCK,
      delHint);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, true);
  }
}
项目:hadoop    文件:BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.DELETED_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeDeletedBlock(bInfo, storageUuid);
  }
}
项目:hadoop    文件:BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.RECEIVING_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, false);
  }
}
项目:hadoop    文件:PBHelper.java   
public static ReceivedDeletedBlockInfoProto convert(
    ReceivedDeletedBlockInfo receivedDeletedBlockInfo) {
  ReceivedDeletedBlockInfoProto.Builder builder = 
      ReceivedDeletedBlockInfoProto.newBuilder();

  ReceivedDeletedBlockInfoProto.BlockStatus status;
  switch (receivedDeletedBlockInfo.getStatus()) {
  case RECEIVING_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVING;
    break;
  case RECEIVED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVED;
    break;
  case DELETED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.DELETED;
    break;
  default:
    throw new IllegalArgumentException("Bad status: " +
        receivedDeletedBlockInfo.getStatus());
  }
  builder.setStatus(status);

  if (receivedDeletedBlockInfo.getDelHints() != null) {
    builder.setDeleteHint(receivedDeletedBlockInfo.getDelHints());
  }
  return builder.setBlock(PBHelper.convert(receivedDeletedBlockInfo.getBlock()))
      .build();
}
项目:hadoop    文件:TestIncrementalBrVariations.java   
private static StorageReceivedDeletedBlocks[] makeReportForReceivedBlock(
    Block block, DatanodeStorage storage) {
  ReceivedDeletedBlockInfo[] receivedBlocks = new ReceivedDeletedBlockInfo[1];
  receivedBlocks[0] = new ReceivedDeletedBlockInfo(block, BlockStatus.RECEIVED_BLOCK, null);
  StorageReceivedDeletedBlocks[] reports = new StorageReceivedDeletedBlocks[1];
  reports[0] = new StorageReceivedDeletedBlocks(storage, receivedBlocks);
  return reports;
}
项目:aliyun-oss-hadoop-fs    文件:BPOfferService.java   
void notifyNamenodeReceivedBlock(
    ExtendedBlock block, String delHint, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
      block.getLocalBlock(),
      ReceivedDeletedBlockInfo.BlockStatus.RECEIVED_BLOCK,
      delHint);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, true);
  }
}
项目:aliyun-oss-hadoop-fs    文件:BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.DELETED_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeDeletedBlock(bInfo, storageUuid);
  }
}
项目:aliyun-oss-hadoop-fs    文件:BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.RECEIVING_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, false);
  }
}
项目:aliyun-oss-hadoop-fs    文件:PBHelper.java   
public static ReceivedDeletedBlockInfoProto convert(
    ReceivedDeletedBlockInfo receivedDeletedBlockInfo) {
  ReceivedDeletedBlockInfoProto.Builder builder = 
      ReceivedDeletedBlockInfoProto.newBuilder();

  ReceivedDeletedBlockInfoProto.BlockStatus status;
  switch (receivedDeletedBlockInfo.getStatus()) {
  case RECEIVING_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVING;
    break;
  case RECEIVED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVED;
    break;
  case DELETED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.DELETED;
    break;
  default:
    throw new IllegalArgumentException("Bad status: " +
        receivedDeletedBlockInfo.getStatus());
  }
  builder.setStatus(status);

  if (receivedDeletedBlockInfo.getDelHints() != null) {
    builder.setDeleteHint(receivedDeletedBlockInfo.getDelHints());
  }
  return builder.setBlock(
      PBHelperClient.convert(receivedDeletedBlockInfo.getBlock())).build();
}
项目:aliyun-oss-hadoop-fs    文件:DFSTestUtil.java   
public static StorageReceivedDeletedBlocks[] makeReportForReceivedBlock(
    Block block, BlockStatus blockStatus, DatanodeStorage storage) {
  ReceivedDeletedBlockInfo[] receivedBlocks = new ReceivedDeletedBlockInfo[1];
  receivedBlocks[0] = new ReceivedDeletedBlockInfo(block, blockStatus, null);
  StorageReceivedDeletedBlocks[] reports = new StorageReceivedDeletedBlocks[1];
  reports[0] = new StorageReceivedDeletedBlocks(storage, receivedBlocks);
  return reports;
}
项目:big-c    文件:BPOfferService.java   
void notifyNamenodeReceivedBlock(
    ExtendedBlock block, String delHint, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
      block.getLocalBlock(),
      ReceivedDeletedBlockInfo.BlockStatus.RECEIVED_BLOCK,
      delHint);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, true);
  }
}
项目:big-c    文件:BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.DELETED_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeDeletedBlock(bInfo, storageUuid);
  }
}
项目:big-c    文件:BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.RECEIVING_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, false);
  }
}
项目:big-c    文件:PBHelper.java   
public static ReceivedDeletedBlockInfoProto convert(
    ReceivedDeletedBlockInfo receivedDeletedBlockInfo) {
  ReceivedDeletedBlockInfoProto.Builder builder = 
      ReceivedDeletedBlockInfoProto.newBuilder();

  ReceivedDeletedBlockInfoProto.BlockStatus status;
  switch (receivedDeletedBlockInfo.getStatus()) {
  case RECEIVING_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVING;
    break;
  case RECEIVED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVED;
    break;
  case DELETED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.DELETED;
    break;
  default:
    throw new IllegalArgumentException("Bad status: " +
        receivedDeletedBlockInfo.getStatus());
  }
  builder.setStatus(status);

  if (receivedDeletedBlockInfo.getDelHints() != null) {
    builder.setDeleteHint(receivedDeletedBlockInfo.getDelHints());
  }
  return builder.setBlock(PBHelper.convert(receivedDeletedBlockInfo.getBlock()))
      .build();
}
项目:big-c    文件:TestIncrementalBrVariations.java   
private static StorageReceivedDeletedBlocks[] makeReportForReceivedBlock(
    Block block, DatanodeStorage storage) {
  ReceivedDeletedBlockInfo[] receivedBlocks = new ReceivedDeletedBlockInfo[1];
  receivedBlocks[0] = new ReceivedDeletedBlockInfo(block, BlockStatus.RECEIVED_BLOCK, null);
  StorageReceivedDeletedBlocks[] reports = new StorageReceivedDeletedBlocks[1];
  reports[0] = new StorageReceivedDeletedBlocks(storage, receivedBlocks);
  return reports;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:BPOfferService.java   
void notifyNamenodeReceivedBlock(
    ExtendedBlock block, String delHint, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
      block.getLocalBlock(),
      ReceivedDeletedBlockInfo.BlockStatus.RECEIVED_BLOCK,
      delHint);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, true);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.DELETED_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeDeletedBlock(bInfo, storageUuid);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.RECEIVING_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, false);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static ReceivedDeletedBlockInfoProto convert(
    ReceivedDeletedBlockInfo receivedDeletedBlockInfo) {
  ReceivedDeletedBlockInfoProto.Builder builder = 
      ReceivedDeletedBlockInfoProto.newBuilder();

  ReceivedDeletedBlockInfoProto.BlockStatus status;
  switch (receivedDeletedBlockInfo.getStatus()) {
  case RECEIVING_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVING;
    break;
  case RECEIVED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVED;
    break;
  case DELETED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.DELETED;
    break;
  default:
    throw new IllegalArgumentException("Bad status: " +
        receivedDeletedBlockInfo.getStatus());
  }
  builder.setStatus(status);

  if (receivedDeletedBlockInfo.getDelHints() != null) {
    builder.setDeleteHint(receivedDeletedBlockInfo.getDelHints());
  }
  return builder.setBlock(PBHelper.convert(receivedDeletedBlockInfo.getBlock()))
      .build();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestIncrementalBrVariations.java   
private static StorageReceivedDeletedBlocks[] makeReportForReceivedBlock(
    Block block, DatanodeStorage storage) {
  ReceivedDeletedBlockInfo[] receivedBlocks = new ReceivedDeletedBlockInfo[1];
  receivedBlocks[0] = new ReceivedDeletedBlockInfo(block, BlockStatus.RECEIVED_BLOCK, null);
  StorageReceivedDeletedBlocks[] reports = new StorageReceivedDeletedBlocks[1];
  reports[0] = new StorageReceivedDeletedBlocks(storage, receivedBlocks);
  return reports;
}
项目:hadoop-plus    文件:BPOfferService.java   
void notifyNamenodeReceivedBlock(ExtendedBlock block, String delHint) {
  checkBlock(block);
  checkDelHint(delHint);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
      block.getLocalBlock(),
      ReceivedDeletedBlockInfo.BlockStatus.RECEIVED_BLOCK,
      delHint);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlockImmediately(bInfo);
  }
}
项目:hadoop-plus    文件:BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.DELETED_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeDeletedBlock(bInfo);
  }
}
项目:hadoop-plus    文件:BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.RECEIVING_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlockImmediately(bInfo);
  }
}
项目:hadoop-plus    文件:PBHelper.java   
public static ReceivedDeletedBlockInfoProto convert(
    ReceivedDeletedBlockInfo receivedDeletedBlockInfo) {
  ReceivedDeletedBlockInfoProto.Builder builder = 
      ReceivedDeletedBlockInfoProto.newBuilder();

  ReceivedDeletedBlockInfoProto.BlockStatus status;
  switch (receivedDeletedBlockInfo.getStatus()) {
  case RECEIVING_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVING;
    break;
  case RECEIVED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVED;
    break;
  case DELETED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.DELETED;
    break;
  default:
    throw new IllegalArgumentException("Bad status: " +
        receivedDeletedBlockInfo.getStatus());
  }
  builder.setStatus(status);

  if (receivedDeletedBlockInfo.getDelHints() != null) {
    builder.setDeleteHint(receivedDeletedBlockInfo.getDelHints());
  }
  return builder.setBlock(PBHelper.convert(receivedDeletedBlockInfo.getBlock()))
      .build();
}
项目:FlexMap    文件:BPOfferService.java   
void notifyNamenodeReceivedBlock(
    ExtendedBlock block, String delHint, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
      block.getLocalBlock(),
      ReceivedDeletedBlockInfo.BlockStatus.RECEIVED_BLOCK,
      delHint);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, true);
  }
}
项目:FlexMap    文件:BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.DELETED_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeDeletedBlock(bInfo, storageUuid);
  }
}
项目:FlexMap    文件:BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block, String storageUuid) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(), BlockStatus.RECEIVING_BLOCK, null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo, storageUuid, false);
  }
}
项目:FlexMap    文件:PBHelper.java   
public static ReceivedDeletedBlockInfoProto convert(
    ReceivedDeletedBlockInfo receivedDeletedBlockInfo) {
  ReceivedDeletedBlockInfoProto.Builder builder = 
      ReceivedDeletedBlockInfoProto.newBuilder();

  ReceivedDeletedBlockInfoProto.BlockStatus status;
  switch (receivedDeletedBlockInfo.getStatus()) {
  case RECEIVING_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVING;
    break;
  case RECEIVED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.RECEIVED;
    break;
  case DELETED_BLOCK:
    status = ReceivedDeletedBlockInfoProto.BlockStatus.DELETED;
    break;
  default:
    throw new IllegalArgumentException("Bad status: " +
        receivedDeletedBlockInfo.getStatus());
  }
  builder.setStatus(status);

  if (receivedDeletedBlockInfo.getDelHints() != null) {
    builder.setDeleteHint(receivedDeletedBlockInfo.getDelHints());
  }
  return builder.setBlock(PBHelper.convert(receivedDeletedBlockInfo.getBlock()))
      .build();
}
项目:FlexMap    文件:TestIncrementalBrVariations.java   
private static StorageReceivedDeletedBlocks[] makeReportForReceivedBlock(
    Block block, DatanodeStorage storage) {
  ReceivedDeletedBlockInfo[] receivedBlocks = new ReceivedDeletedBlockInfo[1];
  receivedBlocks[0] = new ReceivedDeletedBlockInfo(block, BlockStatus.RECEIVED_BLOCK, null);
  StorageReceivedDeletedBlocks[] reports = new StorageReceivedDeletedBlocks[1];
  reports[0] = new StorageReceivedDeletedBlocks(storage, receivedBlocks);
  return reports;
}