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 Summary
Fields Modifier and Type Field Description protected @NonNull com.google.common.cache.LoadingCache<Schema,UUID>schemaDefinitionToVersionCache
-
Constructor Summary
Constructors Constructor Description SchemaByDefinitionFetcher(AWSSchemaRegistryClient awsSchemaRegistryClient, GlueSchemaRegistryConfiguration glueSchemaRegistryConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UUIDgetORRegisterSchemaVersionId(@NonNull String schemaDefinition, @NonNull String schemaName, @NonNull String dataFormat, @NonNull Map<String,String> metadata)Get Schema Version ID by following below steps :
-
-
-
Constructor Detail
-
SchemaByDefinitionFetcher
public SchemaByDefinitionFetcher(AWSSchemaRegistryClient awsSchemaRegistryClient, GlueSchemaRegistryConfiguration glueSchemaRegistryConfiguration)
-
-
Method Detail
-
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 DefinitionschemaName- Schema NamedataFormat- Data Formatmetadata- metadata for schema version- Returns:
- Schema Version ID
- Throws:
AWSSchemaRegistryException- on any error while fetching the schema version ID
-
-