Interface IdGenerator
- All Known Implementing Classes:
IncrementalIdGenerator
public interface IdGenerator
Internal interface used for generating id while registering schema.
-
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.
-
Method Details
-
id
Provides the id for the schema.- Parameters:
schema- the schema being registered; nevernull- Returns:
- the identifier for the schema; never
null - Throws:
IdGenerationException- exception when id can't be generated
-
configure
Configure the underlying generator.- Parameters:
config- Schema Registry Configs
-
init
Initialize the underlying generator.- Throws:
IdGenerationException- exception when IdGenerator can't be initialized
-
getMaxId
Returns the current max id from the generator- Parameters:
schema- current schema in the request to Schema Registry- Returns:
- the max id; never
null
-
schemaRegistered
Callback method that is invoked when a schema is registered. IdGenerator implementation can optionally use this to update the next possible id.- Parameters:
schemaKey- the registered SchemaKey; nevernullschemaValue- the registered SchemaValue; nevernull
-