Class IncrementalIdGenerator
java.lang.Object
io.confluent.kafka.schemaregistry.id.IncrementalIdGenerator
- All Implemented Interfaces:
IdGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(SchemaRegistryConfig config) Configure the underlying generator.intgetMaxId(SchemaValue schema) Returns the current max id from the generatorintid(SchemaValue schema) Provides the id for the schema.voidinit()Initialize the underlying generator.voidschemaRegistered(SchemaKey schemaKey, SchemaValue schemaValue) Callback method that is invoked when a schema is registered.
-
Constructor Details
-
IncrementalIdGenerator
-
-
Method Details
-
id
Description copied from interface:IdGeneratorProvides the id for the schema.- Specified by:
idin interfaceIdGenerator- Parameters:
schema- the schema being registered; nevernull- Returns:
- the identifier for the schema; never
null - Throws:
IdGenerationException- exception when id can't be generated
-
getMaxId
Description copied from interface:IdGeneratorReturns the current max id from the generator- Specified by:
getMaxIdin interfaceIdGenerator- Parameters:
schema- current schema in the request to Schema Registry- Returns:
- the max id; never
null
-
configure
Description copied from interface:IdGeneratorConfigure the underlying generator.- Specified by:
configurein interfaceIdGenerator- Parameters:
config- Schema Registry Configs
-
init
Description copied from interface:IdGeneratorInitialize the underlying generator.- Specified by:
initin interfaceIdGenerator- Throws:
IdGenerationException- exception when IdGenerator can't be initialized
-
schemaRegistered
Description copied from interface:IdGeneratorCallback method that is invoked when a schema is registered. IdGenerator implementation can optionally use this to update the next possible id.- Specified by:
schemaRegisteredin interfaceIdGenerator- Parameters:
schemaKey- the registered SchemaKey; nevernullschemaValue- the registered SchemaValue; nevernull
-