Class DaVinciRecordTransformerUtility<K,​O>

  • Type Parameters:
    K - the type of the input key
    O - the type of the output value

    public class DaVinciRecordTransformerUtility<K,​O>
    extends java.lang.Object
    Utility class for DaVinciRecordTransformer.
    • Constructor Detail

      • DaVinciRecordTransformerUtility

        public DaVinciRecordTransformerUtility​(DaVinciRecordTransformer recordTransformer)
    • Method Detail

      • prependSchemaIdToHeader

        public final java.nio.ByteBuffer prependSchemaIdToHeader​(O value,
                                                                 int schemaId,
                                                                 VeniceCompressor compressor)
        Serializes and compresses the value and prepends the schema ID to the resulting ByteBuffer.
        Parameters:
        value - to be serialized and compressed
        schemaId - to prepend to the ByteBuffer
        Returns:
        a ByteBuffer containing the schema ID followed by the serialized and compressed value
      • prependSchemaIdToHeader

        public final java.nio.ByteBuffer prependSchemaIdToHeader​(java.nio.ByteBuffer valueBytes,
                                                                 int schemaId)
        Prepends the given schema ID to the provided ByteBuffer
        Parameters:
        valueBytes - the original serialized and compressed value
        schemaId - to prepend to the ByteBuffer
        Returns:
        a ByteBuffer containing the schema ID followed by the serialized and compressed value
      • hasTransformerLogicChanged

        public boolean hasTransformerLogicChanged​(int classHash)
        Returns:
        true if transformer logic has changed since the last time the class was loaded
      • getOutputValueSerializer

        public AvroSerializer<O> getOutputValueSerializer()