Examples of AvroDatumConverter


Examples of org.apache.avro.hadoop.io.AvroDatumConverter

        //
        Class keyClass = in.getKeyClass();
        Class valClass = in.getValueClass();
        this.valClassName = valClass.getName();

        AvroDatumConverter keyADC = adcFactory.create(keyClass);
        AvroDatumConverter valADC = adcFactory.create(valClass);
       
        //
        // Build a "pair record" with "key" and "value" fields to hold the subschemas.
        //
        List<Schema.Field> fieldList = new ArrayList<Schema.Field>();       
        //fieldList.add(new Schema.Field("key", keyADC.getWriterSchema(), "", null));
        fieldList.add(new Schema.Field("val", valADC.getWriterSchema(), "", null));
        this.schema = Schema.createRecord("seqschema", "", "", false);
        this.schema.setFields(fieldList);
      } finally {
        in.close();
      }
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.