public class AvroSchemaCompatibility extends Object
NOTE: PLEASE READ CAREFULLY BEFORE CHANGING
This code is borrowed from Avro 1.10, with the following modifications:
| Modifier and Type | Class and Description |
|---|---|
static class |
AvroSchemaCompatibility.Incompatibility |
static class |
AvroSchemaCompatibility.SchemaCompatibilityResult
Immutable class representing details about a particular schema pair
compatibility check.
|
static class |
AvroSchemaCompatibility.SchemaCompatibilityType
Identifies the type of schema compatibility result.
|
static class |
AvroSchemaCompatibility.SchemaIncompatibilityType |
static class |
AvroSchemaCompatibility.SchemaPairCompatibility
Provides information about the compatibility of a single reader and writer
schema pair.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
READER_WRITER_COMPATIBLE_MESSAGE
Message to annotate reader/writer schema pairs that are compatible.
|
| Modifier and Type | Method and Description |
|---|---|
static AvroSchemaCompatibility.SchemaPairCompatibility |
checkReaderWriterCompatibility(org.apache.avro.Schema reader,
org.apache.avro.Schema writer,
boolean checkNamingOverride)
Validates that the provided reader schema can be used to decode avro data
written with the provided writer schema.
|
static org.apache.avro.Schema.Field |
lookupWriterField(org.apache.avro.Schema writerSchema,
org.apache.avro.Schema.Field readerField)
Identifies the writer field that corresponds to the specified reader field.
|
static boolean |
schemaNameEquals(org.apache.avro.Schema reader,
org.apache.avro.Schema writer)
Tests the equality of two Avro named schemas.
|
public static final String READER_WRITER_COMPATIBLE_MESSAGE
public static AvroSchemaCompatibility.SchemaPairCompatibility checkReaderWriterCompatibility(org.apache.avro.Schema reader, org.apache.avro.Schema writer, boolean checkNamingOverride)
reader - schema to check.writer - schema to check.public static boolean schemaNameEquals(org.apache.avro.Schema reader,
org.apache.avro.Schema writer)
Matching includes reader name aliases.
reader - Named reader schema.writer - Named writer schema.public static org.apache.avro.Schema.Field lookupWriterField(org.apache.avro.Schema writerSchema,
org.apache.avro.Schema.Field readerField)
Matching includes reader name aliases.
writerSchema - Schema of the record where to look for the writer field.readerField - Reader field to identify the corresponding writer field
of.Copyright © 2024 The Apache Software Foundation. All rights reserved.