Kinetica   C#   API  Version 7.2.3.0
Avro.Generic.PreresolvingDatumWriter< T > Class Template Referenceabstract

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

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

Classes

interface  ArrayAccess
 
class  DictionaryMapAccess
 
interface  EnumAccess
 
interface  MapAccess
 
class  RecordFieldWriter
 

Public Member Functions

void Write (T datum, Encoder encoder)
 

Protected Member Functions

delegate void WriteItem (Object value, Encoder encoder)
 
 PreresolvingDatumWriter (Schema schema, ArrayAccess arrayAccess, MapAccess mapAccess)
 
void WriteNull (object value, Encoder encoder)
 Serializes a "null" More...
 
void Write< S > (object value, Schema.Type tag, Writer< S > writer)
 A generic method to serialize primitive Avro types. More...
 
abstract void WriteRecordFields (object record, RecordFieldWriter[] writers, Encoder encoder)
 
abstract void EnsureRecordObject (RecordSchema recordSchema, object value)
 
abstract void WriteField (object record, string fieldName, int fieldPos, WriteItem writer, Encoder encoder)
 Extracts the field value from the given object. More...
 
abstract WriteItem ResolveEnum (EnumSchema es)
 Serializes an enumeration. More...
 
WriteItem ResolveArray (ArraySchema schema)
 Serialized an array. More...
 
void WriteMap (WriteItem itemWriter, object value, Encoder encoder)
 Serialized a map. More...
 
int ResolveUnion (UnionSchema us, Schema[] branchSchemas, object obj)
 Finds the branch within the given UnionSchema that matches the given object. More...
 
abstract void WriteFixed (FixedSchema es, object value, Encoder encoder)
 Serialized a fixed object. More...
 
abstract bool UnionBranchMatches (Schema sc, object obj)
 

Static Protected Member Functions

static AvroException TypeMismatch (object obj, string schemaType, string type)
 

Properties

Schema Schema [get]
 
- Properties inherited from Avro.Generic.DatumWriter< T >
Schema Schema [get]
 

Detailed Description

A general purpose writer of data from avro streams.

This writer analyzes the writer schema when constructed so that writes can be more efficient. Once constructed, a writer can be reused or shared among threads to avoid incurring more resolution costs.

Definition at line 31 of file PreresolvingDatumWriter.cs.

Constructor & Destructor Documentation

◆ PreresolvingDatumWriter()

Avro.Generic.PreresolvingDatumWriter< T >.PreresolvingDatumWriter ( Schema  schema,
ArrayAccess  arrayAccess,
MapAccess  mapAccess 
)
inlineprotected

Definition at line 48 of file PreresolvingDatumWriter.cs.

Member Function Documentation

◆ EnsureRecordObject()

abstract void Avro.Generic.PreresolvingDatumWriter< T >.EnsureRecordObject ( RecordSchema  recordSchema,
object  value 
)
protectedpure virtual

◆ ResolveArray()

WriteItem Avro.Generic.PreresolvingDatumWriter< T >.ResolveArray ( ArraySchema  schema)
inlineprotected

Serialized an array.

The default implementation calls EnsureArrayObject() to ascertain that the given value is an array. It then calls GetArrayLength() and GetArrayElement() to access the members of the array and then serialize them.

Parameters
schemaThe ArraySchema for serialization
valueThe value being serialized
encoderThe encoder for serialization

Definition at line 183 of file PreresolvingDatumWriter.cs.

◆ ResolveEnum()

abstract WriteItem Avro.Generic.PreresolvingDatumWriter< T >.ResolveEnum ( EnumSchema  es)
protectedpure virtual

Serializes an enumeration.

Parameters
esThe EnumSchema for serialization

Implemented in Avro.Generic.GenericDatumWriter< T >, and Avro.Specific.SpecificDatumWriter< T >.

◆ ResolveUnion()

int Avro.Generic.PreresolvingDatumWriter< T >.ResolveUnion ( UnionSchema  us,
Schema []  branchSchemas,
object  obj 
)
inlineprotected

Finds the branch within the given UnionSchema that matches the given object.

The default implementation calls Matches() method in the order of branches within the UnionSchema. If nothing matches, throws an exception.

Parameters
usThe UnionSchema to resolve against
objThe object that should be used in matching
Returns

Definition at line 258 of file PreresolvingDatumWriter.cs.

◆ TypeMismatch()

static AvroException Avro.Generic.PreresolvingDatumWriter< T >.TypeMismatch ( object  obj,
string  schemaType,
string  type 
)
inlinestaticprotected

Definition at line 276 of file PreresolvingDatumWriter.cs.

◆ UnionBranchMatches()

abstract bool Avro.Generic.PreresolvingDatumWriter< T >.UnionBranchMatches ( Schema  sc,
object  obj 
)
protectedpure virtual

◆ Write()

void Avro.Generic.PreresolvingDatumWriter< T >.Write ( datum,
Encoder  encoder 
)
inline

Implements Avro.Generic.DatumWriter< T >.

Definition at line 43 of file PreresolvingDatumWriter.cs.

◆ Write< S >()

void Avro.Generic.PreresolvingDatumWriter< T >.Write< S > ( object  value,
Schema.Type  tag,
Writer< S >  writer 
)
inlineprotected

A generic method to serialize primitive Avro types.

Template Parameters
SType of the C# type to be serialized
Parameters
valueThe value to be serialized
tagThe schema type tag
writerThe writer which should be used to write the given type.

Definition at line 111 of file PreresolvingDatumWriter.cs.

◆ WriteField()

abstract void Avro.Generic.PreresolvingDatumWriter< T >.WriteField ( object  record,
string  fieldName,
int  fieldPos,
WriteItem  writer,
Encoder  encoder 
)
protectedpure virtual

Extracts the field value from the given object.

Parameters
valueThe record value from which the field needs to be extracted
fieldNameThe name of the field in the record
fieldPosThe position of field in the record
Returns

Implemented in Avro.Generic.GenericDatumWriter< T >, and Avro.Specific.SpecificDatumWriter< T >.

◆ WriteFixed()

abstract void Avro.Generic.PreresolvingDatumWriter< T >.WriteFixed ( FixedSchema  es,
object  value,
Encoder  encoder 
)
protectedpure virtual

Serialized a fixed object.

The default implementation requires that the value is a GenericFixed object with an identical schema as es.

Parameters
esThe schema for serialization
valueThe value to be serialized
encoderThe encoder for serialization

Implemented in Avro.Specific.SpecificDatumWriter< T >, and Avro.Generic.GenericDatumWriter< T >.

◆ WriteItem()

delegate void Avro.Generic.PreresolvingDatumWriter< T >.WriteItem ( Object  value,
Encoder  encoder 
)
protected

◆ WriteMap()

void Avro.Generic.PreresolvingDatumWriter< T >.WriteMap ( WriteItem  itemWriter,
object  value,
Encoder  encoder 
)
inlineprotected

Serialized a map.

The default implementation first ensure that the value is indeed a map and then uses GetMapSize() and GetMapElements() to access the contents of the map.

Parameters
schemaThe MapSchema for serialization
valueThe value to be serialized
encoderThe encoder for serialization

Definition at line 212 of file PreresolvingDatumWriter.cs.

◆ WriteNull()

void Avro.Generic.PreresolvingDatumWriter< T >.WriteNull ( object  value,
Encoder  encoder 
)
inlineprotected

Serializes a "null"

Parameters
valueThe object to be serialized using null schema
encoderThe encoder to use while serialization

Definition at line 99 of file PreresolvingDatumWriter.cs.

◆ WriteRecordFields()

abstract void Avro.Generic.PreresolvingDatumWriter< T >.WriteRecordFields ( object  record,
RecordFieldWriter []  writers,
Encoder  encoder 
)
protectedpure virtual

Property Documentation

◆ Schema


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