Package org.apache.avro.FooBarSpecificRecord

Examples of org.apache.avro.FooBarSpecificRecord.Builder.build()


    Builder newBuilder = FooBarSpecificRecord.newBuilder();
    newBuilder.setId(42);
    newBuilder.setName("foo");
    newBuilder.setNicknames(Arrays.asList("bar"));
    newBuilder.setRelatedids(Arrays.asList(1,2,3));
    FooBarSpecificRecord specificRecord = newBuilder.build();
   
    byte[] recordBytes = serializeRecord(specificRecord);
   
    Decoder decoder = DecoderFactory.get().binaryDecoder(recordBytes, null);
    SpecificDatumReader<FooBarSpecificRecord> specificDatumReader = new SpecificDatumReader<FooBarSpecificRecord>(FooBarSpecificRecord.SCHEMA$);
View Full Code Here


  @Test
  public void testRead() throws IOException {
    Builder newBuilder = FooBarSpecificRecord.newBuilder();
    newBuilder.setId(42);
    newBuilder.setRelatedids(Arrays.asList(1,2,3));
    FooBarSpecificRecord specificRecord = newBuilder.build();
   
    byte[] recordBytes = serializeRecord(specificRecord);
   
    Decoder decoder = DecoderFactory.get().binaryDecoder(recordBytes, null);
    SpecificDatumReader<FooBarSpecificRecord> specificDatumReader = new SpecificDatumReader<FooBarSpecificRecord>(FooBarSpecificRecord.SCHEMA$);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.