Class KafkaMetadataEncoderService
java.lang.Object
io.confluent.kafka.schemaregistry.storage.encoder.MetadataEncoderService
io.confluent.kafka.schemaregistry.storage.encoder.KafkaMetadataEncoderService
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
FieldsFields inherited from class io.confluent.kafka.schemaregistry.storage.encoder.MetadataEncoderService
encoderSecret, initialized, initLatch, keyTemplate -
Constructor Summary
ConstructorsModifierConstructorDescriptionKafkaMetadataEncoderService(SchemaRegistry schemaRegistry) protectedKafkaMetadataEncoderService(SchemaRegistry schemaRegistry, io.kcache.Cache<String, KeysetWrapper> encoders) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected <K,V> io.kcache.Cache<K, V> createCache(org.apache.kafka.common.serialization.Serde<K> keySerde, org.apache.kafka.common.serialization.Serde<V> valueSerde, String topic, io.kcache.CacheUpdateHandler<K, V> cacheUpdateHandler) protected voiddoInit()Subclass hook to prepare any resources before secret rotation occurs.Get all tenant keys.com.google.crypto.tink.KeysetHandlegetEncoder(String tenant) protected KeysetWrappergetEncoderWrapper(String tenant) Get the encoder wrapper for a tenant.protected com.google.crypto.tink.KeysetHandlegetOrCreateEncoder(String tenant) protected voidputEncoderWrapper(String tenant, KeysetWrapper wrapper) Store an encoder wrapper for a tenant.Methods inherited from class io.confluent.kafka.schemaregistry.storage.encoder.MetadataEncoderService
decodeMetadata, encodeMetadata, encoderOldSecret, encoderSecret, getPrimitive, getSchemaRegistry, init, maybeRotateSecrets, waitForInit
-
Field Details
-
encoders
-
-
Constructor Details
-
KafkaMetadataEncoderService
-
KafkaMetadataEncoderService
protected KafkaMetadataEncoderService(SchemaRegistry schemaRegistry, io.kcache.Cache<String, KeysetWrapper> encoders)
-
-
Method Details
-
createCache
protected <K,V> io.kcache.Cache<K,V> createCache(org.apache.kafka.common.serialization.Serde<K> keySerde, org.apache.kafka.common.serialization.Serde<V> valueSerde, String topic, io.kcache.CacheUpdateHandler<K, V> cacheUpdateHandler) throws io.kcache.exceptions.CacheInitializationException- Throws:
io.kcache.exceptions.CacheInitializationException
-
doInit
protected void doInit()Description copied from class:MetadataEncoderServiceSubclass hook to prepare any resources before secret rotation occurs. Default is no-op.- Overrides:
doInitin classMetadataEncoderService
-
getAllTenants
Description copied from class:MetadataEncoderServiceGet all tenant keys. Used for secret rotation.- Specified by:
getAllTenantsin classMetadataEncoderService
-
getEncoderWrapper
Description copied from class:MetadataEncoderServiceGet the encoder wrapper for a tenant.- Specified by:
getEncoderWrapperin classMetadataEncoderService
-
putEncoderWrapper
Description copied from class:MetadataEncoderServiceStore an encoder wrapper for a tenant.- Specified by:
putEncoderWrapperin classMetadataEncoderService
-
getEncoder
- Specified by:
getEncoderin classMetadataEncoderService
-
getOrCreateEncoder
- Specified by:
getOrCreateEncoderin classMetadataEncoderService
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classMetadataEncoderService
-