Class SchemaByDefinitionFetcher

java.lang.Object
com.amazonaws.services.schemaregistry.common.SchemaByDefinitionFetcher

public class SchemaByDefinitionFetcher extends Object
Fetches the schema version for the given schema definition optionally registering the schema if required.
  • Field Details

    • schemaDefinitionToVersionCache

      @NonNull protected final @NonNull com.google.common.cache.LoadingCache<Schema,UUID> schemaDefinitionToVersionCache
  • Constructor Details

  • Method Details

    • getORRegisterSchemaVersionId

      public UUID getORRegisterSchemaVersionId(@NonNull @NonNull String schemaDefinition, @NonNull @NonNull String schemaName, @NonNull @NonNull String dataFormat, @NonNull @NonNull Map<String,String> metadata) throws AWSSchemaRegistryException
      Get Schema Version ID by following below steps :

      1) If schema version id exists in registry then get it from registry 2) If schema version id does not exist in registry then if auto registration is enabled then if schema exists but version doesn't exist then 2.1) Register schema version else if schema does not exist then 2.2) create schema and register schema version

      Parameters:
      schemaDefinition - Schema Definition
      schemaName - Schema Name
      dataFormat - Data Format
      metadata - metadata for schema version
      Returns:
      Schema Version ID
      Throws:
      AWSSchemaRegistryException - on any error while fetching the schema version ID