Java 类org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.RecoveringBlockProto 实例源码

项目:hadoop    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock)b);
  RecoveringBlockProto.Builder builder = RecoveringBlockProto.newBuilder();
  builder.setBlock(lb).setNewGenStamp(b.getNewGenerationStamp());
  if(b.getNewBlock() != null)
    builder.setTruncateBlock(PBHelper.convert(b.getNewBlock()));
  return builder.build();
}
项目:hadoop    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return (b.hasTruncateBlock()) ?
      new RecoveringBlock(block, locs, PBHelper.convert(b.getTruncateBlock())) :
      new RecoveringBlock(block, locs, b.getNewGenStamp());
}
项目:hadoop    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks = new ArrayList<RecoveringBlock>(
      list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:hadoop    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 };
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (int i=0; i < dnInfo.length; i++) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:big-c    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock)b);
  RecoveringBlockProto.Builder builder = RecoveringBlockProto.newBuilder();
  builder.setBlock(lb).setNewGenStamp(b.getNewGenerationStamp());
  if(b.getNewBlock() != null)
    builder.setTruncateBlock(PBHelper.convert(b.getNewBlock()));
  return builder.build();
}
项目:big-c    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return (b.hasTruncateBlock()) ?
      new RecoveringBlock(block, locs, PBHelper.convert(b.getTruncateBlock())) :
      new RecoveringBlock(block, locs, b.getNewGenStamp());
}
项目:big-c    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks = new ArrayList<RecoveringBlock>(
      list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:big-c    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 };
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (int i=0; i < dnInfo.length; i++) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock)b);
  return RecoveringBlockProto.newBuilder().setBlock(lb)
      .setNewGenStamp(b.getNewGenerationStamp()).build();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks = new ArrayList<RecoveringBlock>(
      list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 };
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (int i=0; i < dnInfo.length; i++) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:hadoop-plus    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock)b);
  return RecoveringBlockProto.newBuilder().setBlock(lb)
      .setNewGenStamp(b.getNewGenerationStamp()).build();
}
项目:hadoop-plus    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks = new ArrayList<RecoveringBlock>(
      list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:hadoop-plus    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 };
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (int i=0; i < dnInfo.length; i++) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:FlexMap    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock)b);
  return RecoveringBlockProto.newBuilder().setBlock(lb)
      .setNewGenStamp(b.getNewGenerationStamp()).build();
}
项目:FlexMap    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks = new ArrayList<RecoveringBlock>(
      list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:FlexMap    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 };
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (int i=0; i < dnInfo.length; i++) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:hops    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock) b);
  return RecoveringBlockProto.newBuilder().setBlock(lb)
      .setNewGenStamp(b.getNewGenerationStamp()).build();
}
项目:hops    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks =
      new ArrayList<>(list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:hops    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[]{di1, di2};
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (DatanodeInfo aDnInfo : dnInfo) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:hadoop-TCP    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock)b);
  return RecoveringBlockProto.newBuilder().setBlock(lb)
      .setNewGenStamp(b.getNewGenerationStamp()).build();
}
项目:hadoop-TCP    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks = new ArrayList<RecoveringBlock>(
      list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:hadoop-TCP    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 };
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (int i=0; i < dnInfo.length; i++) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:hardfs    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock)b);
  return RecoveringBlockProto.newBuilder().setBlock(lb)
      .setNewGenStamp(b.getNewGenerationStamp()).build();
}
项目:hardfs    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks = new ArrayList<RecoveringBlock>(
      list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:hardfs    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 };
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (int i=0; i < dnInfo.length; i++) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static RecoveringBlockProto convert(RecoveringBlock b) {
  if (b == null) {
    return null;
  }
  LocatedBlockProto lb = PBHelper.convert((LocatedBlock)b);
  return RecoveringBlockProto.newBuilder().setBlock(lb)
      .setNewGenStamp(b.getNewGenerationStamp()).build();
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static BlockRecoveryCommand convert(
    BlockRecoveryCommandProto recoveryCmd) {
  List<RecoveringBlockProto> list = recoveryCmd.getBlocksList();
  List<RecoveringBlock> recoveringBlocks = new ArrayList<RecoveringBlock>(
      list.size());

  for (RecoveringBlockProto rbp : list) {
    recoveringBlocks.add(PBHelper.convert(rbp));
  }
  return new BlockRecoveryCommand(recoveringBlocks);
}
项目:hadoop-on-lustre2    文件:TestPBHelper.java   
@Test
public void testConvertRecoveringBlock() {
  DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo();
  DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 };
  RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3);
  RecoveringBlockProto bProto = PBHelper.convert(b);
  RecoveringBlock b1 = PBHelper.convert(bProto);
  assertEquals(b.getBlock(), b1.getBlock());
  DatanodeInfo[] dnInfo1 = b1.getLocations();
  assertEquals(dnInfo.length, dnInfo1.length);
  for (int i=0; i < dnInfo.length; i++) {
    compare(dnInfo[0], dnInfo1[0]);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return new RecoveringBlock(block, locs, b.getNewGenStamp());
}
项目:hadoop-plus    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return new RecoveringBlock(block, locs, b.getNewGenStamp());
}
项目:FlexMap    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return new RecoveringBlock(block, locs, b.getNewGenStamp());
}
项目:hops    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return new RecoveringBlock(block, locs, b.getNewGenStamp());
}
项目:hadoop-TCP    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return new RecoveringBlock(block, locs, b.getNewGenStamp());
}
项目:hardfs    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return new RecoveringBlock(block, locs, b.getNewGenStamp());
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static RecoveringBlock convert(RecoveringBlockProto b) {
  ExtendedBlock block = convert(b.getBlock().getB());
  DatanodeInfo[] locs = convert(b.getBlock().getLocsList());
  return new RecoveringBlock(block, locs, b.getNewGenStamp());
}