public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, row_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, family_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, qualifier_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeUInt64(4, timestamp_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeEnum(5, cellType_.getNumber()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeBytes(6, value_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeBytes(7, tags_); } getUnknownFields().writeTo(output); }
/** * Basic test to verify utility methods in {@link PBType} and delegation to protobuf works. */ @Test public void testRoundTrip() { final Cell cell = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("fam"), Bytes.toBytes("qual"), Bytes.toBytes("val")); CellProtos.Cell c = ProtobufUtil.toCell(cell), decoded; PositionedByteRange pbr = new SimplePositionedByteRange(c.getSerializedSize()); pbr.setPosition(0); int encodedLength = CODEC.encode(pbr, c); pbr.setPosition(0); decoded = CODEC.decode(pbr); assertEquals(encodedLength, pbr.getPosition()); assertTrue(CellUtil.equals(cell, ProtobufUtil .toCell(ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY), decoded))); } }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, row_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, family_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, qualifier_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeUInt64(4, timestamp_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeEnum(5, cellType_.getNumber()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeBytes(6, value_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeBytes(7, tags_); } getUnknownFields().writeTo(output); }
public void writeTo(com.facebook.presto.hbase.$internal.com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, row_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, family_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, qualifier_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeUInt64(4, timestamp_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeEnum(5, cellType_.getNumber()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeBytes(6, value_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeBytes(7, tags_); } getUnknownFields().writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, row_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, family_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, qualifier_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeUInt64(4, timestamp_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeEnum(5, cellType_.getNumber()); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeBytes(6, value_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeBytes(7, tags_); } getUnknownFields().writeTo(output); }
/** * Basic test to verify utility methods in {@link PBType} and delegation to protobuf works. */ @Test public void testRoundTrip() { final Cell cell = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("fam"), Bytes.toBytes("qual"), Bytes.toBytes("val")); CellProtos.Cell c = ProtobufUtil.toCell(cell), decoded; PositionedByteRange pbr = new SimplePositionedByteRange(c.getSerializedSize()); pbr.setPosition(0); int encodedLength = CODEC.encode(pbr, c); pbr.setPosition(0); decoded = CODEC.decode(pbr); assertEquals(encodedLength, pbr.getPosition()); assertTrue(CellUtil.equals(cell, ProtobufUtil .toCell(ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY), decoded))); } }
/** * Basic test to verify utility methods in {@link PBType} and delegation to protobuf works. */ @Test public void testRoundTrip() { final Cell cell = new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("fam"), Bytes.toBytes("qual"), Bytes.toBytes("val")); CellProtos.Cell c = ProtobufUtil.toCell(cell), decoded; PositionedByteRange pbr = new SimplePositionedByteRange(c.getSerializedSize()); pbr.setPosition(0); int encodedLength = CODEC.encode(pbr, c); pbr.setPosition(0); decoded = CODEC.decode(pbr); assertEquals(encodedLength, pbr.getPosition()); assertTrue(CellUtil.equals(cell, ProtobufUtil .toCell(ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY), decoded))); } }