Avro C#
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Properties | List of all members
Avro.Generic.PreresolvingDatumReader< T > Class Template Referenceabstract

A general purpose reader of data from avro streams. This reader analyzes and resolves the reader and writer schemas when constructed so that reads can be more efficient. Once constructed, a reader can be reused or shared among threads to avoid incurring more resolution costs. More...

Inheritance diagram for Avro.Generic.PreresolvingDatumReader< T >:
Avro.Generic.DatumReader< T > Avro.Generic.GenericDatumReader< T > Avro.Specific.SpecificDatumReader< T >

Classes

interface  ArrayAccess
 Defines the interface for a class that provides access to an array implementation. More...
 
interface  EnumAccess
 Defines the interface for a class that provides access to an enum implementation. More...
 
interface  FixedAccess
 Defines the interface for a class that provides access to a fixed implementation. More...
 
interface  MapAccess
 Defines the interface for a class that provides access to a map implementation. More...
 
interface  RecordAccess
 Defines the interface for a class that provides access to a record implementation. More...
 

Public Member Functions

Read (T reuse, Decoder decoder)
 Read a datum. Traverse the schema, depth-first, reading all leaf values in the schema into a datum that is returned. If the provided datum is non-null it may be reused and returned.
 

Protected Member Functions

delegate object ReadItem (object reuse, Decoder dec)
 Defines the signature for a function that reads an item from a decoder. More...
 
 PreresolvingDatumReader (Schema writerSchema, Schema readerSchema)
 Initializes a new instance of the PreresolvingDatumReader<T> class. More...
 
abstract ArrayAccess GetArrayAccess (ArraySchema readerSchema)
 Returns an ArrayAccess implementation for the given schema. More...
 
abstract EnumAccess GetEnumAccess (EnumSchema readerSchema)
 Returns an EnumAccess implementation for the given schema. More...
 
abstract MapAccess GetMapAccess (MapSchema readerSchema)
 Returns a MapAccess implementation for the given schema. More...
 
abstract RecordAccess GetRecordAccess (RecordSchema readerSchema)
 Returns a RecordAccess implementation for the given schema. More...
 
abstract FixedAccess GetFixedAccess (FixedSchema readerSchema)
 Returns a FixedAccess implementation for the given schema. More...
 
virtual bool IsReusable (Schema.Type tag)
 Indicates if it's possible to reuse an object of the specified type. Generally false for immutable objects like int, long, string, etc but may differ between the Specific and Generic implementations. Used to avoid retrieving the existing value if it's not reusable. More...
 

Static Protected Member Functions

static Schema FindBranch (UnionSchema us, Schema s)
 Finds the branch of the union schema associated with the given schema. More...
 

Properties

Schema ReaderSchema [get]
 
Schema WriterSchema [get]
 
- Properties inherited from Avro.Generic.DatumReader< T >
Schema ReaderSchema [get]
 Schema used to read the data. More...
 
Schema WriterSchema [get]
 Schema that was used to write the data. More...
 

Detailed Description

A general purpose reader of data from avro streams. This reader analyzes and resolves the reader and writer schemas when constructed so that reads can be more efficient. Once constructed, a reader can be reused or shared among threads to avoid incurring more resolution costs.

Constructor & Destructor Documentation

◆ PreresolvingDatumReader()

Avro.Generic.PreresolvingDatumReader< T >.PreresolvingDatumReader ( Schema  writerSchema,
Schema  readerSchema 
)
inlineprotected

Initializes a new instance of the PreresolvingDatumReader<T> class.

Parameters
writerSchemaSchema that was used to write the data.
readerSchemaSchema to use to read the data.

Member Function Documentation

◆ FindBranch()

static Schema Avro.Generic.PreresolvingDatumReader< T >.FindBranch ( UnionSchema  us,
Schema  s 
)
inlinestaticprotected

Finds the branch of the union schema associated with the given schema.

Parameters
usUnion schema.
sSchema to find in the union schema.
Returns
Schema branch in the union schema.

◆ GetArrayAccess()

abstract ArrayAccess Avro.Generic.PreresolvingDatumReader< T >.GetArrayAccess ( ArraySchema  readerSchema)
protectedpure virtual

Returns an ArrayAccess implementation for the given schema.

Parameters
readerSchemaSchema for the array.
Returns
An ArrayAccess implementation.

Implemented in Avro.Generic.GenericDatumReader< T >, and Avro.Specific.SpecificDatumReader< T >.

◆ GetEnumAccess()

abstract EnumAccess Avro.Generic.PreresolvingDatumReader< T >.GetEnumAccess ( EnumSchema  readerSchema)
protectedpure virtual

Returns an EnumAccess implementation for the given schema.

Parameters
readerSchemaSchema for the enum.
Returns
An EnumAccess implementation.

Implemented in Avro.Generic.GenericDatumReader< T >, and Avro.Specific.SpecificDatumReader< T >.

◆ GetFixedAccess()

abstract FixedAccess Avro.Generic.PreresolvingDatumReader< T >.GetFixedAccess ( FixedSchema  readerSchema)
protectedpure virtual

Returns a FixedAccess implementation for the given schema.

Parameters
readerSchemaSchema for the fixed.
Returns
A FixedAccess implementation.

Implemented in Avro.Specific.SpecificDatumReader< T >, and Avro.Generic.GenericDatumReader< T >.

◆ GetMapAccess()

abstract MapAccess Avro.Generic.PreresolvingDatumReader< T >.GetMapAccess ( MapSchema  readerSchema)
protectedpure virtual

Returns a MapAccess implementation for the given schema.

Parameters
readerSchemaSchema for the map.
Returns
A MapAccess implementation.

Implemented in Avro.Generic.GenericDatumReader< T >, and Avro.Specific.SpecificDatumReader< T >.

◆ GetRecordAccess()

abstract RecordAccess Avro.Generic.PreresolvingDatumReader< T >.GetRecordAccess ( RecordSchema  readerSchema)
protectedpure virtual

Returns a RecordAccess implementation for the given schema.

Parameters
readerSchemaSchema for the record.
Returns
A RecordAccess implementation.

Implemented in Avro.Generic.GenericDatumReader< T >, and Avro.Specific.SpecificDatumReader< T >.

◆ IsReusable()

virtual bool Avro.Generic.PreresolvingDatumReader< T >.IsReusable ( Schema.Type  tag)
inlineprotectedvirtual

Indicates if it's possible to reuse an object of the specified type. Generally false for immutable objects like int, long, string, etc but may differ between the Specific and Generic implementations. Used to avoid retrieving the existing value if it's not reusable.

Parameters
tagSchema type to test for reusability.

Reimplemented in Avro.Generic.GenericDatumReader< T >, and Avro.Specific.SpecificDatumReader< T >.

◆ ReadItem()

delegate object Avro.Generic.PreresolvingDatumReader< T >.ReadItem ( object  reuse,
Decoder  dec 
)
protected

Defines the signature for a function that reads an item from a decoder.

Parameters
reuseOptional object to deserialize the datum into. May be null.
decDecoder to read data from.
Returns
Deserialized datum.

The documentation for this class was generated from the following file: