Class VsonAvroDatumWriter<K>

  • All Implemented Interfaces:
    org.apache.avro.io.DatumWriter<K>

    @Deprecated
    public class VsonAvroDatumWriter<K>
    extends org.apache.avro.generic.GenericDatumWriter<K>
    Deprecated.
    • Constructor Summary

      Constructors 
      Constructor Description
      VsonAvroDatumWriter​(org.apache.avro.Schema root)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void write​(org.apache.avro.Schema schema, java.lang.Object datum, org.apache.avro.io.Encoder out)
      Deprecated.
       
      protected void writeFixed​(org.apache.avro.Schema schema, java.lang.Object datum, org.apache.avro.io.Encoder out)
      Deprecated.
      In Vson-Avro conversion, Fixed type is specialized for representing 'single byte' or 'short'.
      protected void writeRecord​(org.apache.avro.Schema schema, java.lang.Object datum, org.apache.avro.io.Encoder out)
      Deprecated.
       
      protected void writeUnion​(org.apache.avro.Schema schema, java.lang.Object datum, org.apache.avro.io.Encoder out)
      Deprecated.
      This method is kinda hacking.
      • Methods inherited from class org.apache.avro.generic.GenericDatumWriter

        addAvroTypeMsg, addClassCastMsg, convert, getArrayElements, getArraySize, getData, getMapEntries, getMapSize, npe, resolveUnion, setSchema, write, writeArray, writeBytes, writeEnum, writeField, writeMap, writeString, writeString, writeWithoutConversion
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VsonAvroDatumWriter

        public VsonAvroDatumWriter​(org.apache.avro.Schema root)
        Deprecated.
    • Method Detail

      • write

        protected void write​(org.apache.avro.Schema schema,
                             java.lang.Object datum,
                             org.apache.avro.io.Encoder out)
                      throws java.io.IOException
        Deprecated.
        Overrides:
        write in class org.apache.avro.generic.GenericDatumWriter<K>
        Throws:
        java.io.IOException
      • writeRecord

        protected void writeRecord​(org.apache.avro.Schema schema,
                                   java.lang.Object datum,
                                   org.apache.avro.io.Encoder out)
                            throws java.io.IOException
        Deprecated.
        Overrides:
        writeRecord in class org.apache.avro.generic.GenericDatumWriter<K>
        Throws:
        java.io.IOException
      • writeFixed

        protected void writeFixed​(org.apache.avro.Schema schema,
                                  java.lang.Object datum,
                                  org.apache.avro.io.Encoder out)
                           throws java.io.IOException
        Deprecated.
        In Vson-Avro conversion, Fixed type is specialized for representing 'single byte' or 'short'.
        Overrides:
        writeFixed in class org.apache.avro.generic.GenericDatumWriter<K>
        Throws:
        java.io.IOException
      • writeUnion

        protected void writeUnion​(org.apache.avro.Schema schema,
                                  java.lang.Object datum,
                                  org.apache.avro.io.Encoder out)
                           throws java.io.IOException
        Deprecated.
        This method is kinda hacking. Since we know that 'Union' is only able to have two fields and the index is fixed, we explicitly set them. The reason we don't use GenericData.resolveUnion(org.apache.avro.Schema, java.lang.Object) is that Vson Record is presented as a map. This is inconsistent with GenericData.isRecord(Object) and I am hesitated to involve another override as long as it work fine here. P.S. this also means we need to override write(Schema, Object, Encoder) since 'UNION' is not processed in a method call in super class
        Throws:
        java.io.IOException