Class SchemaByDefinitionFetcher
java.lang.Object
com.amazonaws.services.schemaregistry.common.SchemaByDefinitionFetcher
Fetches the schema version for the given schema definition optionally registering the schema if required.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionSchemaByDefinitionFetcher(AWSSchemaRegistryClient awsSchemaRegistryClient, GlueSchemaRegistryConfiguration glueSchemaRegistryConfiguration) -
Method Summary
-
Field Details
-
schemaDefinitionToVersionCache
-
-
Constructor Details
-
SchemaByDefinitionFetcher
public SchemaByDefinitionFetcher(AWSSchemaRegistryClient awsSchemaRegistryClient, GlueSchemaRegistryConfiguration glueSchemaRegistryConfiguration)
-
-
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 AWSSchemaRegistryExceptionGet 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 DefinitionschemaName- Schema NamedataFormat- Data Formatmetadata- metadata for schema version- Returns:
- Schema Version ID
- Throws:
AWSSchemaRegistryException- on any error while fetching the schema version ID
-