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.
More...
|
void | Write (T datum, Encoder encoder) |
|
|
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. 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. More...
|
|
void | WriteMap (WriteItem itemWriter, object value, Encoder encoder) |
| 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. More...
|
|
int | ResolveUnion (UnionSchema us, Schema[] branchSchemas, object obj) |
| 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. More...
|
|
abstract void | WriteFixed (FixedSchema es, object value, Encoder encoder) |
| Serialized a fixed object. The default implementation requires that the value is a GenericFixed object with an identical schema as es. More...
|
|
abstract bool | UnionBranchMatches (Schema sc, object obj) |
|
|
static AvroException | TypeMismatch (object obj, string schemaType, string type) |
|
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.
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
-
schema | The ArraySchema for serialization |
value | The value being serialized |
encoder | The encoder for serialization |
abstract WriteItem Avro.Generic.PreresolvingDatumWriter< T >.ResolveEnum |
( |
EnumSchema |
es | ) |
|
|
protectedpure virtual |
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
-
us | The UnionSchema to resolve against |
obj | The object that should be used in matching |
- Returns
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
-
S | Type of the C# type to be serialized |
- Parameters
-
value | The value to be serialized |
tag | The schema type tag |
writer | The writer which should be used to write the given type. |
abstract void Avro.Generic.PreresolvingDatumWriter< T >.WriteField |
( |
object |
record, |
|
|
string |
fieldName, |
|
|
int |
fieldPos, |
|
|
WriteItem |
writer, |
|
|
Encoder |
encoder |
|
) |
| |
|
protectedpure virtual |
abstract void Avro.Generic.PreresolvingDatumWriter< T >.WriteFixed |
( |
FixedSchema |
es, |
|
|
object |
value, |
|
|
Encoder |
encoder |
|
) |
| |
|
protectedpure virtual |
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
-
schema | The MapSchema for serialization |
value | The value to be serialized |
encoder | The encoder for serialization |
void Avro.Generic.PreresolvingDatumWriter< T >.WriteNull |
( |
object |
value, |
|
|
Encoder |
encoder |
|
) |
| |
|
inlineprotected |
Serializes a "null"
- Parameters
-
value | The object to be serialized using null schema |
encoder | The encoder to use while serialization |
The documentation for this class was generated from the following file:
- src/apache/main/Generic/PreresolvingDatumWriter.cs