Class ProtobufSerializer
java.lang.Object
com.amazonaws.services.schemaregistry.serializers.protobuf.ProtobufSerializer
- All Implemented Interfaces:
GlueSchemaRegistryDataFormatSerializer
Protobuf serialization helper.
This class is instantiated by GlueSchemaRegistryFacade to serialize Protobuf-type objects
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NonNull com.google.common.cache.LoadingCache<com.google.protobuf.DescriptorProtos.FileDescriptorProto,String> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSchemaDefinition(@NonNull Object object) Get the schema definition.byte[]Serialize the Protobuf object to bytesvoidvoid
-
Field Details
-
schemaGeneratorCache
@NonNull protected final @NonNull com.google.common.cache.LoadingCache<com.google.protobuf.DescriptorProtos.FileDescriptorProto,String> schemaGeneratorCache
-
-
Constructor Details
-
ProtobufSerializer
Constructor- Parameters:
configs- configuration elements
-
-
Method Details
-
serialize
Serialize the Protobuf object to bytes- Specified by:
serializein interfaceGlueSchemaRegistryDataFormatSerializer- Parameters:
data- the Protobuf object for serialization- Returns:
- the serialized byte array
- Throws:
AWSSchemaRegistryException- AWS Schema Registry Exception
-
getSchemaDefinition
Get the schema definition.- Specified by:
getSchemaDefinitionin interfaceGlueSchemaRegistryDataFormatSerializer- Parameters:
object- object for which schema definition has to be derived- Returns:
- schema string
-
validate
public void validate(@NonNull @NonNull String schemaDefinition, @NonNull @lombok.NonNull byte[] data) - Specified by:
validatein interfaceGlueSchemaRegistryDataFormatSerializer
-
validate
- Specified by:
validatein interfaceGlueSchemaRegistryDataFormatSerializer
-