public class ReflectDatumReader<T> extends SpecificDatumReader<T>
DatumReader
for existing classes via
Java reflection.Constructor and Description |
---|
ReflectDatumReader() |
ReflectDatumReader(Class<T> c) |
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 |
readBytes(Object old,
Schema s,
Decoder in)
Called to read byte arrays.
|
protected Object |
readInt(Object old,
Schema expected,
Decoder in)
Called to read integers.
|
protected Object |
readMapKey(Object old,
Schema s,
Decoder in)
Called by the default implementation of
GenericDatumReader.readMap(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to read a
key value. |
protected Object |
readString(Object old,
Decoder in)
Called to read strings.
|
protected Object |
readString(Object old,
Schema s,
Decoder in)
Called to read strings.
|
createEnum, getSpecificData, setSchema
addToMap, createBytes, createFixed, createFixed, getData, getExpected, getResolver, getSchema, newMap, newRecord, read, read, readArray, readBytes, readEnum, readFixed, readMap, readRecord, setExpected, skip
public ReflectDatumReader()
public ReflectDatumReader(Schema root)
public ReflectDatumReader(Schema writer, Schema reader)
public ReflectDatumReader(Schema writer, Schema reader, ReflectData data)
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 readMapKey(Object old, Schema s, Decoder in) throws IOException
GenericDatumReader
GenericDatumReader.readMap(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to read a
key value. The default implementation returns delegates to
GenericDatumReader.readString(Object, org.apache.avro.io.Decoder)
.readMapKey
in class GenericDatumReader<T>
IOException
protected Object readString(Object old, Schema s, Decoder in) throws IOException
GenericDatumReader
GenericDatumReader.readString(Object,Decoder)
.readString
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
Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.