private HdfsProtos.BlockProto.Builder createBlockBuilder(Node block) throws IOException { HdfsProtos.BlockProto.Builder blockBld = HdfsProtos.BlockProto.newBuilder(); Long id = block.removeChildLong(SECTION_ID); if (id == null) { throw new IOException("<block> found without <id>"); } blockBld.setBlockId(id); Long genstamp = block.removeChildLong(INODE_SECTION_GENSTAMP); if (genstamp == null) { throw new IOException("<block> found without <genstamp>"); } blockBld.setGenStamp(genstamp); Long numBytes = block.removeChildLong(INODE_SECTION_NUM_BYTES); if (numBytes == null) { throw new IOException("<block> found without <numBytes>"); } blockBld.setNumBytes(numBytes); return blockBld; }
public Builder mergeFrom(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto other) { if (other == org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto.getDefaultInstance()) return this; if (other.hasBlockId()) { setBlockId(other.getBlockId()); } if (other.hasGenStamp()) { setGenStamp(other.getGenStamp()); } if (other.hasNumBytes()) { setNumBytes(other.getNumBytes()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public static BlockProto convert(Block b) { return BlockProto.newBuilder().setBlockId(b.getBlockId()) .setGenStamp(b.getGenerationStamp()).setNumBytes(b.getNumBytes()) .build(); }
public static BlockProto convert(Block b) { return BlockProto.newBuilder().setBlockId(b.getBlockId()) .setGenStamp(b.getGenerationStamp()).setNumBytes(b.getNumBytes()) .build(); }
public static BlockProto convert(Block b) { return BlockProto.newBuilder().setBlockId(b.getBlockId()) .setGenStamp(b.getGenerationStamp()).setNumBytes(b.getNumBytes()) .build(); }
protected BlockProto buildBlock(long blockId, long bytes, long genstamp) { BlockProto.Builder b = BlockProto.newBuilder() .setBlockId(blockId) .setNumBytes(bytes) .setGenStamp(genstamp); return b.build(); }