Namespace AvroSharp.Generic
Reads and writes Avro data without generated types, as AvroValues, with records as GenericRecord and fixed values as GenericFixed.
GenericDatumWriterandGenericDatumReaderhandle the binary encoding. A reader created with a writer schema and a reader schema applies schema resolution.GenericDatumJsonWriterandGenericDatumJsonReaderhandle the Avro JSON encoding.AvroValueTransformerreplaces values inside record fields.
The schemas come from AvroSharp.Schemas. The generic overloads of AvroSharp.Containers, AvroSharp.Messages and AvroSharp.Streams (CreateGeneric, OpenGeneric) use these readers and writers.
Classes
- AvroBinaryComparer
Compares Avro binary data by the specification's sort order for one schema, without decoding it, as Apache Avro Java's
BinaryData.comparedoes (and as Hadoop sorts by it). Both inputs are read at once, only as far as the first difference. Instances are cached per schema and are thread-safe.
- AvroRandomData
Random values of a schema, for property tests and fuzz corpora, as Apache Avro Java's
RandomDatamakes them. The same seed and options give the same values, on every target framework.
- AvroRandomDataOptions
The shape of the values AvroRandomData generates.
- AvroValueComparer
Compares AvroValue data by the specification's sort order for one schema, as Apache Avro Java's
GenericData.comparedoes. Instances are cached per schema and are thread-safe.
- AvroValueTransformer
Walks a generic value together with its schema and replaces values inside it: the basis for field-level data rules, encryption and redaction.
- GenericDatumJsonReader
Reads the Avro JSON encoding into AvroValues for one schema. Instances are cached per schema and are thread-safe.
- GenericDatumJsonWriter
Writes AvroValue data in the Avro JSON encoding for one schema. The schema is compiled once into a tree of typed writer nodes; instances are cached per schema and are thread-safe.
- GenericDatumReader
Reads Avro binary data into AvroValues for one schema. The schema is compiled once into a tree of typed reader nodes, so reading does not inspect the schema; instances are cached per schema and are thread-safe.
- GenericDatumReaderOptions
Limits that protect GenericDatumReader against malformed or hostile input.
- GenericDatumWriter
Writes AvroValue data in Avro binary encoding for one schema. The schema is compiled once into a tree of typed writer nodes, so writing does not inspect the schema; instances are cached per schema and are thread-safe.
- GenericDatumWriterOptions
Limits for GenericDatumWriter and GenericDatumJsonWriter, and the JSON writer's labels.
- GenericFixed
A fixed value in the generic data model: a schema and exactly Size bytes.
- GenericRecord
A record in the generic data model: a schema and one AvroValue per field.
- GenericRecordBuilder
Builds a GenericRecord field by field, as Apache Avro Java's
GenericRecordBuilderdoes: a field left unset takes its schema default, and a field with neither a value nor a default is an error.
Structs
- AvroFieldContext
Where a value handed to an AvroFieldTransform is: the record field, and the value's schema.
- AvroValue
Any Avro value in the generic data model, without boxing: primitives are stored inline, and strings, bytes, records, enums, arrays, maps and fixed values by reference.
Enums
- AvroValueKind
The kind of value held by an AvroValue.
- JsonUnionBranchNames
How GenericDatumJsonWriter labels a union value's branch.
Delegates
- AvroFieldTransform
Replaces a value found inside a record field. Receives the field it is in and the value; returns the value to keep, which may be the same one.