Kinetica   C#   API  Version 7.2.3.0
Avro.Generic.GenericReader< T > Class Template Reference

A general purpose reader of data from avro streams. More...

+ Inheritance diagram for Avro.Generic.GenericReader< T >:
+ Collaboration diagram for Avro.Generic.GenericReader< T >:

Public Member Functions

 GenericReader (Schema writerSchema, Schema readerSchema)
 Constructs a generic reader for the given schemas using the DefaultReader. More...
 
 GenericReader (DefaultReader reader)
 Constructs a generic reader by directly using the given DefaultReader More...
 
Read (T reuse, Decoder d)
 Read a datum. More...
 

Properties

Schema WriterSchema [get]
 
Schema ReaderSchema [get]
 
- Properties inherited from Avro.Generic.DatumReader< T >
Schema ReaderSchema [get]
 
Schema WriterSchema [get]
 

Detailed Description

A general purpose reader of data from avro streams.

This can optionally resolve if the reader's and writer's schemas are different. This class is a wrapper around DefaultReader and offers a little more type safety. The default reader has the flexibility to return any type of object for each read call because the Read() method is generic. This class on the other hand can only return a single type because the type is a parameter to the class. Any user defined extension should, however, be done to DefaultReader. This class is sealed.

Template Parameters
T

Definition at line 35 of file GenericReader.cs.

Constructor & Destructor Documentation

◆ GenericReader() [1/2]

Avro.Generic.GenericReader< T >.GenericReader ( Schema  writerSchema,
Schema  readerSchema 
)
inline

Constructs a generic reader for the given schemas using the DefaultReader.

If the reader's and writer's schemas are different this class performs the resolution.

Parameters
writerSchemaThe schema used while generating the data
readerSchemaThe schema desired by the reader

Definition at line 45 of file GenericReader.cs.

◆ GenericReader() [2/2]

Constructs a generic reader by directly using the given DefaultReader

Parameters
readerThe actual reader to use

Definition at line 54 of file GenericReader.cs.

Member Function Documentation

◆ Read()

T Avro.Generic.GenericReader< T >.Read ( reuse,
Decoder  decoder 
)
inline

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.

Implements Avro.Generic.DatumReader< T >.

Definition at line 63 of file GenericReader.cs.

Property Documentation

◆ ReaderSchema

Schema Avro.Generic.GenericReader< T >.ReaderSchema
get

Definition at line 61 of file GenericReader.cs.

◆ WriterSchema

Schema Avro.Generic.GenericReader< T >.WriterSchema
get

Definition at line 59 of file GenericReader.cs.


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