Top Description Constructors Methods
org.apache.avro

pack-priv Class ValidateMutualRead

extends Object
implements SchemaValidationStrategy
Class Inheritance
All Implemented Interfaces
org.apache.avro.SchemaValidationStrategy
Imports
java.io.IOException, org.apache.avro.io.parsing.ResolvingGrammarGenerator, .Symbol

A SchemaValidationStrategy that checks that the Schema to validate and the existing schema can mutually read each other according to the default Avro schema resolution rules.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
canRead(Schema
The "writer's" schema, representing data to be read.
writtenWith
,
Schema
The "reader's" schema, representing how the reader will interpret data.
readUsing
)

Validates that data written with one schema can be read using another, based on the default Avro schema resolution rules.

public void
validate(Schema toValidate, Schema existing)

Implements org.apache.avro.SchemaValidationStrategy.validate.

Validate that the schemas provided can mutually read data written by each other according to the default Avro schema resolution rules.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ValidateMutualReadback to summary
pack-priv ValidateMutualRead()

Method Detail

canReadback to summary
pack-priv static void canRead(Schema writtenWith, Schema readUsing) throws SchemaValidationException

Validates that data written with one schema can be read using another, based on the default Avro schema resolution rules.

Parameters
writtenWith:Schema

The "writer's" schema, representing data to be read.

readUsing:Schema

The "reader's" schema, representing how the reader will interpret data.

Exceptions
SchemaValidationException:
if the schema readUsing cannot be used to read data written with writtenWith
validateback to summary
public void validate(Schema toValidate, Schema existing) throws SchemaValidationException

Implements org.apache.avro.SchemaValidationStrategy.validate.

Validate that the schemas provided can mutually read data written by each other according to the default Avro schema resolution rules.

Annotations
@Override
Exceptions
SchemaValidationException:
if the schemas are not mutually compatible.