Interface SchemaProvider

All Superinterfaces:
org.apache.kafka.common.Configurable
All Known Implementing Classes:
AbstractSchemaProvider, AvroSchemaProvider

public interface SchemaProvider extends org.apache.kafka.common.Configurable
A factory for parsed schemas.

This factory produces instances of ParsedSchema. To have schema registry use a specific factory, the fully qualified class name of the factory needs to be specified using the configuration property schema.providers, which takes a comma-separated list of such factories.

  • Field Details

  • Method Details

    • configure

      default void configure(Map<String,?> configs)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable
    • schemaType

      String schemaType()
      Returns the schema type.
      Returns:
      the schema type
    • parseSchema

      default Optional<ParsedSchema> parseSchema(Schema schema, boolean isNew)
      Parses a schema.
      Parameters:
      schema - the schema
      isNew - whether the schema is new
      Returns:
      an optional parsed schema
    • parseSchema

      default Optional<ParsedSchema> parseSchema(Schema schema, boolean isNew, boolean normalize)
      Parses a schema.
      Parameters:
      schema - the schema
      isNew - whether the schema is new
      normalize - whether to normalize the schema
      Returns:
      an optional parsed schema
    • parseSchema

      default Optional<ParsedSchema> parseSchema(String schemaString, List<SchemaReference> references, boolean isNew)
      Parses a string representing a schema.
      Parameters:
      schemaString - the schema
      references - a list of schema references
      isNew - whether the schema is new
      Returns:
      an optional parsed schema
    • parseSchema

      default Optional<ParsedSchema> parseSchema(String schemaString, List<SchemaReference> references, boolean isNew, boolean normalize)
      Parses a string representing a schema.
      Parameters:
      schemaString - the schema
      references - a list of schema references
      isNew - whether the schema is new
      normalize - whether to normalize the schema
      Returns:
      an optional parsed schema
    • parseSchema

      default Optional<ParsedSchema> parseSchema(String schemaString, List<SchemaReference> references)
    • parseSchemaOrElseThrow

      ParsedSchema parseSchemaOrElseThrow(Schema schema, boolean isNew, boolean normalize)
      Parses a string representing a schema.
      Parameters:
      schema - the schema
      isNew - whether the schema is new
      normalize - whether to normalize the schema
      Returns:
      a parsed schema or throw an error