Class DaVinciRecordTransformerUtility<K,O>

java.lang.Object
com.linkedin.davinci.client.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 Object
Utility class for DaVinciRecordTransformer.
  • Constructor Details

  • Method Details

    • prependSchemaIdToHeader

      public final 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 ByteBuffer prependSchemaIdToHeader(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
    • onRecovery

      public final void onRecovery(AbstractStorageEngine storageEngine, Integer partition, Lazy<VeniceCompressor> compressor)
      Bootstraps the client after it comes online.