Class LogicalSchemaProvider
java.lang.Object
io.confluent.kafka.schemaregistry.AbstractSchemaProvider
io.confluent.kafka.schemaregistry.type.logical.LogicalSchemaProvider
- All Implemented Interfaces:
SchemaProvider,org.apache.kafka.common.Configurable
- Direct Known Subclasses:
LogicalAvroSchemaProvider,LogicalJsonSchemaProvider,LogicalProtobufSchemaProvider
A schema provider that also accepts schemas written as logical types DDL, converting them to
the native format of the provider it wraps.
Native-first, the same rule the registry applies: the body is handed to the wrapped provider first, and only a body that provider rejects is tried as DDL. So a native schema always wins, and a body that is neither reports the native error rather than a misleading DDL one.
Note that this converts locally. A caller that wants the registry to do the conversion -- so that what it stores is decided server-side -- must send the DDL itself rather than the schema this returns.
-
Field Summary
Fields inherited from class io.confluent.kafka.schemaregistry.AbstractSchemaProvider
REFERENCE_VERSIONS_STRICT_CONFIGFields inherited from interface io.confluent.kafka.schemaregistry.SchemaProvider
LOG, SCHEMA_PROVIDERS_PREFIX, SCHEMA_VERSION_FETCHER_CONFIG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic booleanReturns whethertextis logical types DDL, without converting it.booleanisSubjectDependent(Schema schema) A DDL body reads the subject, to name a root the script leaves anonymous.parseSchemaOrElseThrow(Schema schema, boolean validateAsNew, boolean normalize) resolveReferences(Schema schema, boolean validateAsNew) Methods inherited from class io.confluent.kafka.schemaregistry.AbstractSchemaProvider
canLookupIgnoringVersion, getConfluentVersion, getConfluentVersionNumber, hasLatestVersion, replaceLatestVersion, resolveReferences, resolveReferences, schemaVersionFetcherMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.confluent.kafka.schemaregistry.SchemaProvider
parseSchema, parseSchema, parseSchema, parseSchema, parseSchema
-
Constructor Details
-
LogicalSchemaProvider
-
-
Method Details
-
isLogical
Returns whethertextis logical types DDL, without converting it. -
schemaType
-
isSubjectDependent
A DDL body reads the subject, to name a root the script leaves anonymous. A native body is handed to the delegate untouched, so whether it reads the subject is the delegate's to say -- a wrapped provider that depends on the subject must not lose that by being wrapped. -
configure
- Specified by:
configurein interfaceorg.apache.kafka.common.Configurable- Specified by:
configurein interfaceSchemaProvider- Overrides:
configurein classAbstractSchemaProvider
-
parseSchemaOrElseThrow
-
resolveReferences
- Overrides:
resolveReferencesin classAbstractSchemaProvider
-