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
Utility class for
DaVinciRecordTransformer
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasTransformerLogicChanged
(int classHash) final void
onRecovery
(AbstractStorageEngine storageEngine, Integer partition, Lazy<VeniceCompressor> compressor) Bootstraps the client after it comes online.final ByteBuffer
prependSchemaIdToHeader
(ByteBuffer valueBytes, int schemaId) Prepends the given schema ID to the provided ByteBufferfinal ByteBuffer
prependSchemaIdToHeader
(O value, int schemaId, VeniceCompressor compressor) Serializes and compresses the value and prepends the schema ID to the resulting ByteBuffer.
-
Constructor Details
-
DaVinciRecordTransformerUtility
-
-
Method Details
-
prependSchemaIdToHeader
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
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, Integer partition, Lazy<VeniceCompressor> compressor) Bootstraps the client after it comes online.
-