public class ReflectDatumReader<T> extends SpecificDatumReader<T>
DatumReader
for existing classes via
Java reflection.Constructor and Description |
---|
ReflectDatumReader() |
ReflectDatumReader(Class<T> c)
Construct for reading instances of a class.
|
ReflectDatumReader(ReflectData data)
Construct given a
ReflectData . |
ReflectDatumReader(Schema root)
Construct where the writer's and reader's schemas are the same.
|
ReflectDatumReader(Schema writer,
Schema reader)
Construct given writer's and reader's schema.
|
ReflectDatumReader(Schema writer,
Schema reader,
ReflectData data)
Construct given writer's and reader's schema and the data model.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToArray(Object array,
long pos,
Object e)
Called by the default implementation of
GenericDatumReader.readArray(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to add a
value. |
protected Object |
createString(String value)
Called to create a string from a default value.
|
protected Object |
newArray(Object old,
int size,
Schema schema)
Called to create new array instances.
|
protected Object |
peekArray(Object array)
Called by the default implementation of
GenericDatumReader.readArray(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to retrieve a
value from a reused instance. |
protected Object |
readArray(Object old,
Schema expected,
ResolvingDecoder in)
Called to read an array instance.
|
protected Object |
readBytes(Object old,
Schema s,
Decoder in)
Called to read byte arrays.
|
protected void |
readField(Object record,
Schema.Field f,
Object oldDatum,
ResolvingDecoder in,
Object state)
Called to read a single field of a record.
|
protected Object |
readInt(Object old,
Schema expected,
Decoder in)
Called to read integers.
|
protected Object |
readString(Object old,
Decoder in)
Called to read strings.
|
findStringClass, getSpecificData, setSchema
addToMap, convert, createBytes, createEnum, createFixed, createFixed, getData, getExpected, getResolver, getSchema, newInstanceFromString, newMap, newRecord, read, read, readBytes, readEnum, readFixed, readMap, readMapKey, readRecord, readString, readWithConversion, readWithoutConversion, setExpected, skip
public ReflectDatumReader()
public ReflectDatumReader(Class<T> c)
public ReflectDatumReader(Schema root)
public ReflectDatumReader(Schema writer, Schema reader)
public ReflectDatumReader(Schema writer, Schema reader, ReflectData data)
public ReflectDatumReader(ReflectData data)
ReflectData
.protected Object newArray(Object old, int size, Schema schema)
GenericDatumReader
GenericData.Array
.newArray
in class GenericDatumReader<T>
protected Object peekArray(Object array)
GenericDatumReader
GenericDatumReader.readArray(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to retrieve a
value from a reused instance. The default implementation is for GenericArray
.peekArray
in class GenericDatumReader<T>
protected void addToArray(Object array, long pos, Object e)
GenericDatumReader
GenericDatumReader.readArray(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to add a
value. The default implementation is for Collection
.addToArray
in class GenericDatumReader<T>
protected Object readArray(Object old, Schema expected, ResolvingDecoder in) throws IOException
GenericDatumReader
readArray
in class GenericDatumReader<T>
IOException
protected Object readString(Object old, Decoder in) throws IOException
GenericDatumReader
Decoder.readString(Utf8)
.readString
in class GenericDatumReader<T>
IOException
protected Object createString(String value)
GenericDatumReader
Utf8.Utf8(String)
.createString
in class GenericDatumReader<T>
protected Object readBytes(Object old, Schema s, Decoder in) throws IOException
GenericDatumReader
Decoder.readBytes(ByteBuffer)
.readBytes
in class GenericDatumReader<T>
IOException
protected Object readInt(Object old, Schema expected, Decoder in) throws IOException
GenericDatumReader
Decoder.readInt()
.readInt
in class GenericDatumReader<T>
IOException
protected void readField(Object record, Schema.Field f, Object oldDatum, ResolvingDecoder in, Object state) throws IOException
GenericDatumReader
readField
in class GenericDatumReader<T>
IOException
Copyright © 2009–2016 The Apache Software Foundation. All rights reserved.