微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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()),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()),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()),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()),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()),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()),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()),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()),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()),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,BlockStatus.RECEIVING_BLOCK,null);

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeBlock(bInfo,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,null);
  StorageReceivedDeletedBlocks[] reports = new StorageReceivedDeletedBlocks[1];
  reports[0] = new StorageReceivedDeletedBlocks(storage,receivedBlocks);
  return reports;
}
项目:aliyun-oss-hadoop-fs    文件BPOfferService.java   
void notifyNamenodeReceivedBlock(
    ExtendedBlock block,true);
  }
}
项目:aliyun-oss-hadoop-fs    文件BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block,storageUuid);
  }
}
项目:aliyun-oss-hadoop-fs    文件BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block,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,blockStatus,receivedBlocks);
  return reports;
}
项目:big-c    文件BPOfferService.java   
void notifyNamenodeReceivedBlock(
    ExtendedBlock block,true);
  }
}
项目:big-c    文件BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block,storageUuid);
  }
}
项目:big-c    文件BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block,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,receivedBlocks);
  return reports;
}
项目:hadoop-2.6.0-cdh5.4.3    文件BPOfferService.java   
void notifyNamenodeReceivedBlock(
    ExtendedBlock block,true);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block,storageUuid);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block,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,receivedBlocks);
  return reports;
}
项目:hadoop-plus    文件BPOfferService.java   
void notifyNamenodeReceivedBlock(ExtendedBlock block,String delHint) {
  checkBlock(block);
  checkDelHint(delHint);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
      block.getLocalBlock(),delHint);

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

  for (BPServiceActor actor : bpServices) {
    actor.notifyNamenodeDeletedBlock(bInfo);
  }
}
项目:hadoop-plus    文件BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block) {
  checkBlock(block);
  ReceivedDeletedBlockInfo bInfo = new ReceivedDeletedBlockInfo(
     block.getLocalBlock(),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,true);
  }
}
项目:FlexMap    文件BPOfferService.java   
void notifyNamenodeDeletedBlock(ExtendedBlock block,storageUuid);
  }
}
项目:FlexMap    文件BPOfferService.java   
void notifyNamenodeReceivingBlock(ExtendedBlock block,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,receivedBlocks);
  return reports;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。