public abstract class AbstractKafkaSchemaSerDe extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractKafkaSchemaSerDe.ExtendedSchema |
protected static class |
AbstractKafkaSchemaSerDe.Migration |
protected static class |
AbstractKafkaSchemaSerDe.SubjectSchema |
| Constructor and Description |
|---|
AbstractKafkaSchemaSerDe() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearKey() |
void |
close() |
protected void |
configureClientProperties(AbstractKafkaSchemaSerDeConfig config,
SchemaProvider provider) |
protected Object |
executeMigrations(List<AbstractKafkaSchemaSerDe.Migration> migrations,
String subject,
String topic,
org.apache.kafka.common.header.Headers headers,
Object message) |
protected Object |
executeRules(String subject,
String topic,
org.apache.kafka.common.header.Headers headers,
Object original,
RuleMode ruleMode,
ParsedSchema source,
ParsedSchema target,
Object message) |
protected Object |
executeRules(String subject,
String topic,
org.apache.kafka.common.header.Headers headers,
RuleMode ruleMode,
ParsedSchema source,
ParsedSchema target,
Object message) |
org.apache.avro.Schema |
getById(int id)
Deprecated.
|
org.apache.avro.Schema |
getBySubjectAndId(String subject,
int id)
Deprecated.
|
protected ByteBuffer |
getByteBuffer(byte[] payload) |
protected String |
getContextName(String topic) |
protected String |
getContextName(String topic,
String subject) |
protected AbstractKafkaSchemaSerDe.ExtendedSchema |
getLatestWithMetadata(String subject) |
protected List<AbstractKafkaSchemaSerDe.Migration> |
getMigrations(String subject,
ParsedSchema writerSchema,
ParsedSchema readerSchema) |
protected String |
getOldSubjectName(Object value)
Get the subject name used by the old Encoder interface, which relies only on the value type
rather than the topic.
|
Map<String,Map<String,RuleBase>> |
getRuleActions() |
Map<String,Map<String,RuleBase>> |
getRuleExecutors() |
ParsedSchema |
getSchemaById(int id) |
ParsedSchema |
getSchemaBySubjectAndId(String subject,
int id) |
SchemaRegistryClient |
getSchemaRegistryClient() |
protected String |
getSubjectName(String topic,
boolean isKey,
Object value,
ParsedSchema schema)
Get the subject name for the given topic and value type.
|
protected boolean |
isDeprecatedSubjectNameStrategy(boolean isKey) |
boolean |
isKey() |
static Object |
key() |
protected Map<AbstractKafkaSchemaSerDe.SubjectSchema,AbstractKafkaSchemaSerDe.ExtendedSchema> |
latestVersionsCache() |
protected Map<String,AbstractKafkaSchemaSerDe.ExtendedSchema> |
latestWithMetadataCache() |
protected static AbstractKafkaSchemaSerDe.ExtendedSchema |
lookupLatestVersion(SchemaRegistryClient schemaRegistry,
String subject,
ParsedSchema schema,
Map<AbstractKafkaSchemaSerDe.SubjectSchema,AbstractKafkaSchemaSerDe.ExtendedSchema> cache,
boolean latestCompatStrict) |
protected AbstractKafkaSchemaSerDe.ExtendedSchema |
lookupLatestVersion(String subject,
ParsedSchema schema,
boolean latestCompatStrict) |
protected ParsedSchema |
lookupSchemaBySubjectAndId(String subject,
int id,
ParsedSchema schema,
boolean idCompatStrict) |
protected void |
postOp(Object payload) |
int |
register(String subject,
ParsedSchema schema) |
int |
register(String subject,
ParsedSchema schema,
boolean normalize) |
int |
register(String subject,
org.apache.avro.Schema schema)
Deprecated.
|
protected Schema |
registerWithResponse(String subject,
ParsedSchema schema,
boolean normalize,
boolean propagateSchemaTags) |
static void |
setKey(Object obj) |
protected boolean |
strategyUsesSchema(boolean isKey) |
protected com.google.common.base.Ticker |
ticker(SchemaRegistryClient client) |
protected static org.apache.kafka.common.KafkaException |
toKafkaException(RestClientException e,
String errorMessage) |
protected static final byte MAGIC_BYTE
protected static final int idSize
protected static final int DEFAULT_CACHE_CAPACITY
protected AbstractKafkaSchemaSerDeConfig config
protected SchemaRegistryClient schemaRegistry
protected com.google.common.base.Ticker ticker
protected ContextNameStrategy contextNameStrategy
protected Object keySubjectNameStrategy
protected Object valueSubjectNameStrategy
protected com.google.common.cache.Cache<AbstractKafkaSchemaSerDe.SubjectSchema,AbstractKafkaSchemaSerDe.ExtendedSchema> latestVersions
protected com.google.common.cache.Cache<String,AbstractKafkaSchemaSerDe.ExtendedSchema> latestWithMetadata
protected boolean useSchemaReflection
protected boolean useLatestVersion
protected boolean enableRuleServiceLoader
protected boolean isKey
public static Object key()
public static void setKey(Object obj)
public static void clearKey()
protected com.google.common.base.Ticker ticker(SchemaRegistryClient client)
protected void configureClientProperties(AbstractKafkaSchemaSerDeConfig config, SchemaProvider provider)
protected void postOp(Object payload)
public SchemaRegistryClient getSchemaRegistryClient()
public boolean isKey()
protected Map<AbstractKafkaSchemaSerDe.SubjectSchema,AbstractKafkaSchemaSerDe.ExtendedSchema> latestVersionsCache()
protected Map<String,AbstractKafkaSchemaSerDe.ExtendedSchema> latestWithMetadataCache()
protected AbstractKafkaSchemaSerDe.ExtendedSchema getLatestWithMetadata(String subject) throws IOException, RestClientException
IOExceptionRestClientExceptionprotected List<AbstractKafkaSchemaSerDe.Migration> getMigrations(String subject, ParsedSchema writerSchema, ParsedSchema readerSchema) throws IOException, RestClientException
IOExceptionRestClientExceptionprotected String getSubjectName(String topic, boolean isKey, Object value, ParsedSchema schema)
protected boolean strategyUsesSchema(boolean isKey)
protected boolean isDeprecatedSubjectNameStrategy(boolean isKey)
protected String getOldSubjectName(Object value)
@Deprecated public int register(String subject, org.apache.avro.Schema schema) throws IOException, RestClientException
IOExceptionRestClientExceptionpublic int register(String subject, ParsedSchema schema) throws IOException, RestClientException
IOExceptionRestClientExceptionpublic int register(String subject, ParsedSchema schema, boolean normalize) throws IOException, RestClientException
IOExceptionRestClientExceptionprotected Schema registerWithResponse(String subject, ParsedSchema schema, boolean normalize, boolean propagateSchemaTags) throws IOException, RestClientException
IOExceptionRestClientException@Deprecated public org.apache.avro.Schema getById(int id) throws IOException, RestClientException
IOExceptionRestClientExceptionpublic ParsedSchema getSchemaById(int id) throws IOException, RestClientException
IOExceptionRestClientException@Deprecated public org.apache.avro.Schema getBySubjectAndId(String subject, int id) throws IOException, RestClientException
IOExceptionRestClientExceptionpublic ParsedSchema getSchemaBySubjectAndId(String subject, int id) throws IOException, RestClientException
IOExceptionRestClientExceptionprotected ParsedSchema lookupSchemaBySubjectAndId(String subject, int id, ParsedSchema schema, boolean idCompatStrict) throws IOException, RestClientException
IOExceptionRestClientExceptionprotected AbstractKafkaSchemaSerDe.ExtendedSchema lookupLatestVersion(String subject, ParsedSchema schema, boolean latestCompatStrict) throws IOException, RestClientException
IOExceptionRestClientExceptionprotected static AbstractKafkaSchemaSerDe.ExtendedSchema lookupLatestVersion(SchemaRegistryClient schemaRegistry, String subject, ParsedSchema schema, Map<AbstractKafkaSchemaSerDe.SubjectSchema,AbstractKafkaSchemaSerDe.ExtendedSchema> cache, boolean latestCompatStrict) throws IOException, RestClientException
IOExceptionRestClientExceptionprotected ByteBuffer getByteBuffer(byte[] payload)
protected Object executeMigrations(List<AbstractKafkaSchemaSerDe.Migration> migrations, String subject, String topic, org.apache.kafka.common.header.Headers headers, Object message) throws IOException
IOExceptionprotected Object executeRules(String subject, String topic, org.apache.kafka.common.header.Headers headers, RuleMode ruleMode, ParsedSchema source, ParsedSchema target, Object message)
protected Object executeRules(String subject, String topic, org.apache.kafka.common.header.Headers headers, Object original, RuleMode ruleMode, ParsedSchema source, ParsedSchema target, Object message)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected static org.apache.kafka.common.KafkaException toKafkaException(RestClientException e, String errorMessage)
Copyright © 2025 Confluent, Inc.. All rights reserved.