Package org.apache.avro.protobuf
Class ProtobufDatumReader<T>
java.lang.Object
org.apache.avro.generic.GenericDatumReader<T>
org.apache.avro.protobuf.ProtobufDatumReader<T>
- All Implemented Interfaces:
DatumReader<T>
DatumReader
for generated Protobuf
classes.-
Constructor Summary
ModifierConstructorDescriptionProtobufDatumReader
(Schema schema) Construct where the writer's and reader's schemas are the same.ProtobufDatumReader
(Schema writer, Schema reader) Construct given writer's and reader's schema.protected
ProtobufDatumReader
(Schema writer, Schema reader, ProtobufData data) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
createEnum
(String symbol, Schema schema) Called to create an enum value.protected Object
Called to read byte arrays.protected Object
readRecord
(Object old, Schema expected, ResolvingDecoder in) Called to read a record instance.Methods inherited from class org.apache.avro.generic.GenericDatumReader
addToArray, addToMap, convert, createBytes, createFixed, createFixed, createString, findStringClass, getData, getExpected, getResolver, getSchema, newArray, newInstanceFromString, newMap, newRecord, peekArray, read, read, readArray, readBytes, readEnum, readField, readFixed, readInt, readMap, readMapKey, readString, readString, readWithConversion, readWithoutConversion, setExpected, setSchema, skip
-
Constructor Details
-
ProtobufDatumReader
public ProtobufDatumReader() -
ProtobufDatumReader
-
ProtobufDatumReader
Construct where the writer's and reader's schemas are the same. -
ProtobufDatumReader
Construct given writer's and reader's schema. -
ProtobufDatumReader
-
-
Method Details
-
readRecord
Description copied from class:GenericDatumReader
Called to read a record instance. May be overridden for alternate record representations.- Overrides:
readRecord
in classGenericDatumReader<T>
- Throws:
IOException
-
createEnum
Description copied from class:GenericDatumReader
Called to create an enum value. May be overridden for alternate enum representations. By default, returns a GenericEnumSymbol.- Overrides:
createEnum
in classGenericDatumReader<T>
-
readBytes
Description copied from class:GenericDatumReader
Called to read byte arrays. Subclasses may override to use a different byte array representation. By default, this callsDecoder.readBytes(ByteBuffer)
.- Overrides:
readBytes
in classGenericDatumReader<T>
- Throws:
IOException
-