Interface SchemaIncompatibilityChecker

All Known Implementing Classes:
DefaultSchemaIncompatibilityChecker

public interface SchemaIncompatibilityChecker
Provides functionality for incompatibility checks.
Since:
4.11.0
Author:
Simon Zambrovski, Jan Galinski
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    assertSchemaCompatibility(Class<?> readerType, org.apache.avro.Schema readerSchema, org.apache.avro.Schema writerSchema, boolean includeSchemasInStackTraces)
    Checks schema compatibilities and throws exception if schemas are not compatible.
    default List<org.apache.avro.SchemaCompatibility.Incompatibility>
    checkCompatibility(org.apache.avro.Schema readerSchema, org.apache.avro.Schema writerSchema)
    Performs compatibility check.
  • Method Details

    • assertSchemaCompatibility

      default void assertSchemaCompatibility(@Nonnull Class<?> readerType, @Nonnull org.apache.avro.Schema readerSchema, @Nonnull org.apache.avro.Schema writerSchema, boolean includeSchemasInStackTraces)
      Checks schema compatibilities and throws exception if schemas are not compatible.
      Parameters:
      readerType - The intended reader type.
      readerSchema - The schema available on the reader side.
      writerSchema - The schema that was used to write the data.
      includeSchemasInStackTraces - A flag if schemas should be included in stack traces.
      Throws:
      ConversionException - if the schema check has not passed.
    • checkCompatibility

      @Nonnull default List<org.apache.avro.SchemaCompatibility.Incompatibility> checkCompatibility(@Nonnull org.apache.avro.Schema readerSchema, @Nonnull org.apache.avro.Schema writerSchema)
      Performs compatibility check.
      Parameters:
      readerSchema - reader schema to check.
      writerSchema - writer schema to check.
      Returns:
      list of compatibilities if any, or empty list