Package org.apache.avro.specific
Class SpecificDatumReader<T>
java.lang.Object
org.apache.avro.generic.GenericDatumReader<T>
org.apache.avro.specific.SpecificDatumReader<T>
- All Implemented Interfaces:
DatumReader<T>
- Direct Known Subclasses:
ReflectDatumReader
DatumReader for generated Java
classes.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct for reading instances of a class.SpecificDatumReader(Schema schema) Construct where the writer's and reader's schemas are the same.SpecificDatumReader(Schema writer, Schema reader) Construct given writer's and reader's schema.SpecificDatumReader(Schema writer, Schema reader, SpecificData data) Construct given writer's schema, reader's schema, and aSpecificData.Construct given aSpecificData. -
Method Summary
Modifier and TypeMethodDescriptionprotected ClassfindStringClass(Schema schema) Determines the class to used to represent a string Schema.Return the containedSpecificData.protected voidreadField(Object record, Schema.Field field, Object oldDatum, ResolvingDecoder in, Object state) Called to read a single field of a record.protected ObjectreadRecord(Object old, Schema expected, ResolvingDecoder in) Called to read a record instance.voidSet the writer's schema.Methods inherited from class org.apache.avro.generic.GenericDatumReader
addToArray, addToMap, convert, createBytes, createEnum, createFixed, createFixed, createString, getData, getExpected, getResolver, getSchema, newArray, newInstanceFromString, newMap, newRecord, peekArray, read, read, readArray, readBytes, readBytes, readEnum, readFixed, readInt, readMap, readMapKey, readString, readString, readWithConversion, readWithoutConversion, setExpected, skip
-
Field Details
-
SERIALIZABLE_PACKAGES
-
-
Constructor Details
-
SpecificDatumReader
public SpecificDatumReader() -
SpecificDatumReader
Construct for reading instances of a class. -
SpecificDatumReader
Construct where the writer's and reader's schemas are the same. -
SpecificDatumReader
Construct given writer's and reader's schema. -
SpecificDatumReader
Construct given writer's schema, reader's schema, and aSpecificData. -
SpecificDatumReader
Construct given aSpecificData.
-
-
Method Details
-
getSpecificData
Return the containedSpecificData. -
setSchema
Description copied from interface:DatumReaderSet the writer's schema.- Specified by:
setSchemain interfaceDatumReader<T>- Overrides:
setSchemain classGenericDatumReader<T>
-
findStringClass
Description copied from class:GenericDatumReaderDetermines the class to used to represent a string Schema. By default usesGenericData.STRING_PROPto determine whetherUtf8orStringis used. Subclasses may override for alternate representations.- Overrides:
findStringClassin classGenericDatumReader<T>
-
getTrustedPackages
-
readRecord
Description copied from class:GenericDatumReaderCalled to read a record instance. May be overridden for alternate record representations.- Overrides:
readRecordin classGenericDatumReader<T>- Throws:
IOException
-
readField
protected void readField(Object record, Schema.Field field, Object oldDatum, ResolvingDecoder in, Object state) throws IOException Description copied from class:GenericDatumReaderCalled to read a single field of a record. May be overridden for more efficient or alternate implementations.- Overrides:
readFieldin classGenericDatumReader<T>- Throws:
IOException
-