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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Deprecated.protected void
writeFixed
(org.apache.avro.Schema schema, 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, Object datum, org.apache.avro.io.Encoder out) Deprecated.protected void
writeUnion
(org.apache.avro.Schema schema, 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
-
Constructor Details
-
VsonAvroDatumWriter
public VsonAvroDatumWriter(org.apache.avro.Schema root) Deprecated.
-
-
Method Details
-
write
protected void write(org.apache.avro.Schema schema, Object datum, org.apache.avro.io.Encoder out) throws IOException Deprecated.- Overrides:
write
in classorg.apache.avro.generic.GenericDatumWriter<K>
- Throws:
IOException
-
writeRecord
protected void writeRecord(org.apache.avro.Schema schema, Object datum, org.apache.avro.io.Encoder out) throws IOException Deprecated.- Overrides:
writeRecord
in classorg.apache.avro.generic.GenericDatumWriter<K>
- Throws:
IOException
-
writeFixed
protected void writeFixed(org.apache.avro.Schema schema, Object datum, org.apache.avro.io.Encoder out) throws 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:
IOException
-
writeUnion
protected void writeUnion(org.apache.avro.Schema schema, Object datum, org.apache.avro.io.Encoder out) throws 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:
IOException
-