Package com.linkedin.venice.schema.vson
Class VsonAvroDatumWriter<K>
- java.lang.Object
-
- org.apache.avro.generic.GenericDatumWriter<K>
-
- com.linkedin.venice.schema.vson.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
-
-
-
-
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 classorg.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 classorg.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 classorg.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 useGenericData.resolveUnion(org.apache.avro.Schema, java.lang.Object)
is that Vson Record is presented as a map. This is inconsistent withGenericData.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 overridewrite(Schema, Object, Encoder)
since 'UNION' is not processed in a method call in super class- Throws:
java.io.IOException
-
-