Package org.apache.avro
A Schema
provides an abstract definition of
a data type.
The in-memory representation of data is determined by DatumReader
and DatumWriter
implementations. Generic
implementations are provided in the org.apache.avro.generic
package. A
invalid @link
{@link <a href="../../../org/apache/avro/compiler/specific/SpecificCompiler.html" title="class in org.apache.avro.compiler.specific">
compiler
} can generate specific java classes and interfaces for
schemas and protocols. Schemas may be automatically generated for
existing Java classes by reflection using the org.apache.avro.reflect
package.
Data of a given schema is always serialized identically, regardless
of its in-memory representation, by traversing the schema and
writing leaf values from the data structure with a Encoder
. Deserializing similarly proceeds by
traversing the schema, reading leaf values with a Decoder
and storing them in an in-memory data
structure.
-
ClassDescriptionAvro exception in case of missing fields.Base class for exceptions thrown to client by server.Base Avro exception.Thrown when an illegal type is used.Schema formatter factory that supports the "Parsing Canonical Form".Conversion<T>Conversion between generic and logical type instances.Schema parser for a specific schema format.Base class for objects that have JSON-valued properties.Schema parser for JSON formatted schemata.Logical types provides an opt-in way to extend Avro's types.Date represents a date without a timeDecimal represents arbitrary-precision fixed-scale decimal numbersDuration represents a duration, consisting on months, days and millisecondsFactory interface and SPI for logical types.TimeMicros represents a time in microseconds without a dateTimeMillis represents a time in milliseconds without a dateTimestampMicros represents a date and time in microsecondsTimestampMillis represents a date and time in millisecondsTimestampNanos represents a date and time in nanosecondsUuid represents a uuid without a timeClass to define a name context, useful to reference schemata with.A set of messages forming an application protocol.Encapsulate schema-resolution logic in an easy-to-consume representation.An abstract class for an action to be taken to resolve a writer's schema (found in public instance variable writer) against a reader's schema (in reader).Helps us traverse faster.Used for array and map schemas: the public instance variable elementAction contains the resolving action needed for the element type of an array or value top of a map.In this case, there's nothing to be done for resolution: the two schemas are effectively the same.Contains information needed to resolve enumerations.In this case there is an error.In this case, the writer's type needs to be promoted to the reader's.In this case, the reader is a union and the writer is not.Instructions for resolving two record schemas.This only appears inside
Resolver.RecordAdjust.fieldActions
, i.e., the actions for adjusting the fields of a record.In this case, the writer was a union.An abstract data type.A field within a record.How values of this field should be ordered when sorting records.A parser for JSON-format schemas.Useful as key ofMap
s when traversing two schemas at the same time and need to watch for recursion.The type of schema.A fluent interface for buildingSchema
instances.Builds an Avro Array type with optional properties.Choose whether to use a default value for the field or not.A special Builder for Record fields.A common API for building types within a context.Builds an Avro boolean type with optional properties.Choose whether to use a default value for the field or not.Builds an Avro bytes type with optional properties.Choose whether to use a default value for the field or not.Builds an Avro double type with optional properties.Choose whether to use a default value for the field or not.Builds an Avro Enum type with optional properties, namespace, doc, and aliases.Choose whether to use a default value for the field or not.Builds a Field in the context of aSchemaBuilder.FieldAssembler
.SchemaBuilder.FieldDefault<R,S extends SchemaBuilder.FieldDefault<R, S>> Abstract base class for field defaults.FieldTypeBuilder addsSchemaBuilder.FieldTypeBuilder.unionOf()
,SchemaBuilder.FieldTypeBuilder.nullable()
, andSchemaBuilder.FieldTypeBuilder.optional()
to BaseFieldTypeBuilder.Builds an Avro Fixed type with optional properties, namespace, doc, and aliases.Choose whether to use a default value for the field or not.Builds an Avro float type with optional properties.Choose whether to use a default value for the field or not.Builds an Avro int type with optional properties.Choose whether to use a default value for the field or not.Builds an Avro long type with optional properties.Choose whether to use a default value for the field or not.Builds an Avro Map type with optional properties.Choose whether to use a default value for the field or not.SchemaBuilder.NamedBuilder<S extends SchemaBuilder.NamedBuilder<S>>An abstract type that provides builder methods for configuring the name, doc, and aliases of all Avro types that have names (fields, Fixed, Record, and Enum).SchemaBuilder.NamespacedBuilder<R,S extends SchemaBuilder.NamespacedBuilder<R, S>> An abstract type that provides builder methods for configuring the namespace for all Avro types that have namespaces (Fixed, Record, and Enum).Builds an Avro null type with optional properties.Choose whether to use a default value for the field or not.SchemaBuilder.PropBuilder<S extends SchemaBuilder.PropBuilder<S>>An abstract builder for all Avro types.Choose whether to use a default value for the field or not.Builds an Avro string type with optional properties.Choose whether to use a default value for the field or not.A Builder for creating any Avro schema type.Accumulates all of the types in a union.Builder for a union field.Thrown for errors building schemas.Evaluate the compatibility between a reader schema and a writer schema.Immutable class representing details about a particular schema pair compatibility check.Identifies the type of a schema compatibility result.Provides information about the compatibility of a single reader and writer schema pair.Interface and factory to format schemas to text.Service Provider Interface (SPI) forSchemaFormatter
.Collection of static methods for generating the canonical form of schemas (seeSchemaNormalization.toParsingForm(org.apache.avro.Schema)
) -- and fingerprints of canonical forms (SchemaNormalization.fingerprint(java.lang.String, byte[])
).Thrown for errors parsing schemas and protocols.Avro schema parser for text-based formats like JSON, IDL, etc.Thrown whenSchemaValidator
fails to validate a schema.An interface for validating the compatibility of a single schema against another.A SchemaValidator has one method, which validates that aSchema
is compatible with the other schemas provided.A Builder for creating SchemaValidators.Thrown to prevent making large allocations when reading potentially pathological input data from an untrusted source.Thrown when the expected contents of a union cannot be resolved.ASchemaValidator
for validating the provided schema against all schemas in the Iterable inValidateAll.validate(Schema, Iterable)
.ASchemaValidator
for validating the provided schema against the firstSchema
in the iterable inValidateLatest.validate(Schema, Iterable)
.