Kinetica   C#   API  Version 7.2.3.0
Avro.Specific.SpecificDefaultWriter Class Reference

Class for writing data from any specific objects More...

+ Inheritance diagram for Avro.Specific.SpecificDefaultWriter:
+ Collaboration diagram for Avro.Specific.SpecificDefaultWriter:

Public Member Functions

 SpecificDefaultWriter (Schema schema)
 Constructor More...
 
- Public Member Functions inherited from Avro.Generic.DefaultWriter
 DefaultWriter (Schema schema)
 Constructs a generic writer for the given schema. More...
 
void Write< T > (T value, Encoder encoder)
 
virtual void Write (Schema schema, object value, Encoder encoder)
 Examines the schema and dispatches the actual work to one of the other methods of this class. More...
 

Protected Member Functions

override void WriteRecord (RecordSchema schema, object value, Encoder encoder)
 Serialized a record using the given RecordSchema. More...
 
override void WriteFixed (FixedSchema schema, object value, Encoder encoder)
 Validates that the record is a fixed record object and that the schema in the object is the same as the given writer schema. More...
 
override void WriteEnum (EnumSchema schema, object value, Encoder encoder)
 Writes the given enum value into the given encoder. More...
 
override void WriteArray (ArraySchema schema, object value, Encoder encoder)
 Serialized an array. More...
 
override void WriteMap (MapSchema schema, object value, Encoder encoder)
 Writes the given map into the given encoder. More...
 
override void WriteUnion (UnionSchema us, object value, Encoder encoder)
 Resolves the given value against the given UnionSchema and serializes the object against the resolved schema member. More...
 
override bool Matches (Schema sc, object obj)
 
- Protected Member Functions inherited from Avro.Generic.DefaultWriter
virtual void WriteNull (object value, Encoder encoder)
 Serializes a "null" More...
 
virtual void Write< S > (object value, Schema.Type tag, Writer< S > writer)
 A generic method to serialize primitive Avro types. More...
 
virtual void EnsureRecordObject (RecordSchema s, object value)
 
virtual object GetField (object value, string fieldName, int fieldPos)
 Extracts the field value from the given object. More...
 
virtual void EnsureArrayObject (object value)
 Checks if the given object is an array. More...
 
virtual long GetArrayLength (object value)
 Returns the length of an array. More...
 
virtual object GetArrayElement (object value, long index)
 Returns the element at the given index from the given array object. More...
 
virtual void EnsureMapObject (object value)
 Checks if the given object is a map. More...
 
virtual long GetMapSize (object value)
 Returns the size of the map object. More...
 
virtual IEnumerable< KeyValuePair< string, object > > GetMapValues (object value)
 Returns the contents of the given map object. More...
 
virtual int ResolveUnion (UnionSchema us, object obj)
 Finds the branch within the given UnionSchema that matches the given object. More...
 
AvroException TypeMismatch (object obj, string schemaType, string type)
 

Additional Inherited Members

- Properties inherited from Avro.Generic.DefaultWriter
Schema Schema [get]
 

Detailed Description

Class for writing data from any specific objects

Definition at line 40 of file SpecificWriter.cs.

Constructor & Destructor Documentation

◆ SpecificDefaultWriter()

Avro.Specific.SpecificDefaultWriter.SpecificDefaultWriter ( Schema  schema)
inline

Constructor

Parameters
schemaschema of the object to be written

Definition at line 46 of file SpecificWriter.cs.

Member Function Documentation

◆ Matches()

override bool Avro.Specific.SpecificDefaultWriter.Matches ( Schema  sc,
object  obj 
)
inlineprotectedvirtual

Reimplemented from Avro.Generic.DefaultWriter.

Definition at line 175 of file SpecificWriter.cs.

◆ WriteArray()

override void Avro.Specific.SpecificDefaultWriter.WriteArray ( ArraySchema  schema,
object  value,
Encoder  encoder 
)
inlineprotectedvirtual

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

Reimplemented from Avro.Generic.DefaultWriter.

Definition at line 113 of file SpecificWriter.cs.

◆ WriteEnum()

override void Avro.Specific.SpecificDefaultWriter.WriteEnum ( EnumSchema  schema,
object  value,
Encoder  encoder 
)
inlineprotectedvirtual

Writes the given enum value into the given encoder.

Parameters
schemawriter schema
valueenum value
encoderencoder to write to

Reimplemented from Avro.Generic.DefaultWriter.

Definition at line 97 of file SpecificWriter.cs.

◆ WriteFixed()

override void Avro.Specific.SpecificDefaultWriter.WriteFixed ( FixedSchema  schema,
object  value,
Encoder  encoder 
)
inlineprotectedvirtual

Validates that the record is a fixed record object and that the schema in the object is the same as the given writer schema.

Writes the given fixed record into the given encoder

Parameters
schemawriter schema
valuefixed object to write
encoderencoder to write to

Reimplemented from Avro.Generic.DefaultWriter.

Definition at line 82 of file SpecificWriter.cs.

◆ WriteMap()

override void Avro.Specific.SpecificDefaultWriter.WriteMap ( MapSchema  schema,
object  value,
Encoder  encoder 
)
inlineprotectedvirtual

Writes the given map into the given encoder.

Parameters
schemawriter schema
valuemap to write
encoderencoder to write to

Reimplemented from Avro.Generic.DefaultWriter.

Definition at line 136 of file SpecificWriter.cs.

◆ WriteRecord()

override void Avro.Specific.SpecificDefaultWriter.WriteRecord ( RecordSchema  schema,
object  value,
Encoder  encoder 
)
inlineprotectedvirtual

Serialized a record using the given RecordSchema.

It uses GetField method to extract the field value from the given object.

Parameters
schemaThe RecordSchema to use for serialization
valueThe value to be serialized
encoderThe Encoder for serialization

Reimplemented from Avro.Generic.DefaultWriter.

Definition at line 56 of file SpecificWriter.cs.

◆ WriteUnion()

override void Avro.Specific.SpecificDefaultWriter.WriteUnion ( UnionSchema  us,
object  value,
Encoder  encoder 
)
inlineprotectedvirtual

Resolves the given value against the given UnionSchema and serializes the object against the resolved schema member.

The default implementation of this method uses ResolveUnion to find the member schema within the UnionSchema.

Parameters
usThe UnionSchema to resolve against
valueThe value to be serialized
encoderThe encoder for serialization

Reimplemented from Avro.Generic.DefaultWriter.

Definition at line 161 of file SpecificWriter.cs.


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