Class GlueSchemaRegistryDeserializerDataParser


  • public final class GlueSchemaRegistryDeserializerDataParser
    extends Object
    Parser that understands the schema registry data format and extracts schema id from serialized data, also performs data integrity validations.
    • Method Detail

      • getSchemaVersionId

        public UUID getSchemaVersionId​(ByteBuffer byteBuffer)
        Gets the schema version id embedded within the data.
        Parameters:
        byteBuffer - data from where schema version id has to be extracted as ByteBuffer
        Returns:
        schema UUID
        Throws:
        GlueSchemaRegistryIncompatibleDataException - when the data is incompatible with schema registry
      • isDataCompatible

        public boolean isDataCompatible​(ByteBuffer byteBuffer,
                                        StringBuilder errorBuilder)
        Validates the data for compatibility with schema registry.
        Parameters:
        byteBuffer - input data as byte buffer
        errorBuilder - error message for the validation that can be used by the caller
        Returns:
        true - validation success; false - otherwise
      • getPlainData

        public byte[] getPlainData​(ByteBuffer byteBuffer)
      • isCompressionEnabled

        public boolean isCompressionEnabled​(ByteBuffer byteBuffer)
        Is Compression enabled
        Parameters:
        byteBuffer - byte buffer
        Returns:
        whether the byte buffer has been compressed
      • getCompressionByte

        public Byte getCompressionByte​(ByteBuffer byteBuffer)
        Get the compression byte.
        Parameters:
        byteBuffer - byte buffer
        Returns:
        compression byte
      • getHeaderVersionByte

        public Byte getHeaderVersionByte​(ByteBuffer byteBuffer)
        Get the header version byte.
        Parameters:
        byteBuffer - byte buffer
        Returns:
        header byte