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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voiddefault Optional<ParsedSchema>parseSchema(Schema schema, boolean isNew) Parses a schema.default Optional<ParsedSchema>parseSchema(Schema schema, boolean isNew, boolean normalize) Parses a schema.default Optional<ParsedSchema>parseSchema(String schemaString, List<SchemaReference> references) default Optional<ParsedSchema>parseSchema(String schemaString, List<SchemaReference> references, boolean isNew) Parses a string representing a schema.default Optional<ParsedSchema>parseSchema(String schemaString, List<SchemaReference> references, boolean isNew, boolean normalize) Parses a string representing a schema.parseSchemaOrElseThrow(Schema schema, boolean isNew, boolean normalize) Parses a string representing a schema.Returns the schema type.
-
Field Details
-
SCHEMA_VERSION_FETCHER_CONFIG
- See Also:
-
-
Method Details
-
configure
- Specified by:
configurein interfaceorg.apache.kafka.common.Configurable
-
schemaType
String schemaType()Returns the schema type.- Returns:
- the schema type
-
parseSchema
Parses a schema.- Parameters:
schema- the schemaisNew- whether the schema is new- Returns:
- an optional parsed schema
-
parseSchema
Parses a schema.- Parameters:
schema- the schemaisNew- whether the schema is newnormalize- 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 schemareferences- a list of schema referencesisNew- 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 schemareferences- a list of schema referencesisNew- whether the schema is newnormalize- whether to normalize the schema- Returns:
- an optional parsed schema
-
parseSchema
-
parseSchemaOrElseThrow
Parses a string representing a schema.- Parameters:
schema- the schemaisNew- whether the schema is newnormalize- whether to normalize the schema- Returns:
- a parsed schema or throw an error
-