Class IncrementalIdGenerator

java.lang.Object
io.confluent.kafka.schemaregistry.id.IncrementalIdGenerator
All Implemented Interfaces:
IdGenerator

public class IncrementalIdGenerator extends Object implements IdGenerator
  • Constructor Details

    • IncrementalIdGenerator

      public IncrementalIdGenerator(SchemaRegistry schemaRegistry)
  • Method Details

    • id

      public int id(SchemaValue schema) throws IdGenerationException
      Description copied from interface: IdGenerator
      Provides the id for the schema.
      Specified by:
      id in interface IdGenerator
      Parameters:
      schema - the schema being registered; never null
      Returns:
      the identifier for the schema; never null
      Throws:
      IdGenerationException - exception when id can't be generated
    • getMaxId

      public int getMaxId(SchemaValue schema)
      Description copied from interface: IdGenerator
      Returns the current max id from the generator
      Specified by:
      getMaxId in interface IdGenerator
      Parameters:
      schema - current schema in the request to Schema Registry
      Returns:
      the max id; never null
    • configure

      public void configure(SchemaRegistryConfig config)
      Description copied from interface: IdGenerator
      Configure the underlying generator.
      Specified by:
      configure in interface IdGenerator
      Parameters:
      config - Schema Registry Configs
    • init

      public void init() throws IdGenerationException
      Description copied from interface: IdGenerator
      Initialize the underlying generator.
      Specified by:
      init in interface IdGenerator
      Throws:
      IdGenerationException - exception when IdGenerator can't be initialized
    • schemaRegistered

      public void schemaRegistered(SchemaKey schemaKey, SchemaValue schemaValue)
      Description copied from interface: IdGenerator
      Callback method that is invoked when a schema is registered. IdGenerator implementation can optionally use this to update the next possible id.
      Specified by:
      schemaRegistered in interface IdGenerator
      Parameters:
      schemaKey - the registered SchemaKey; never null
      schemaValue - the registered SchemaValue; never null