Package com.linkedin.davinci.client
Class DaVinciRecordTransformerUtility<K,O>
- java.lang.Object
-
- com.linkedin.davinci.client.DaVinciRecordTransformerUtility<K,O>
-
- Type Parameters:
K
- the type of the input keyO
- the type of the output value
public class DaVinciRecordTransformerUtility<K,O> extends java.lang.Object
Utility class forDaVinciRecordTransformer
.
-
-
Constructor Summary
Constructors Constructor Description DaVinciRecordTransformerUtility(DaVinciRecordTransformer recordTransformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AvroGenericDeserializer<K>
getKeyDeserializer()
AvroGenericDeserializer<O>
getOutputValueDeserializer()
AvroSerializer<O>
getOutputValueSerializer()
boolean
hasTransformerLogicChanged(int classHash)
void
onRecovery(AbstractStorageEngine storageEngine, java.lang.Integer partition, Lazy<VeniceCompressor> compressor)
Bootstraps the client after it comes online.java.nio.ByteBuffer
prependSchemaIdToHeader(java.nio.ByteBuffer valueBytes, int schemaId)
Prepends the given schema ID to the provided ByteBufferjava.nio.ByteBuffer
prependSchemaIdToHeader(O value, int schemaId, VeniceCompressor compressor)
Serializes and compresses the value and prepends the schema ID to the resulting ByteBuffer.
-
-
-
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 compressedschemaId
- 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 valueschemaId
- 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, java.lang.Integer partition, Lazy<VeniceCompressor> compressor)
Bootstraps the client after it comes online.
-
getKeyDeserializer
public AvroGenericDeserializer<K> getKeyDeserializer()
-
getOutputValueDeserializer
public AvroGenericDeserializer<O> getOutputValueDeserializer()
-
getOutputValueSerializer
public AvroSerializer<O> getOutputValueSerializer()
-
-