Package com.linkedin.davinci.consumer
Class BootstrappingVeniceChangelogConsumerDaVinciRecordTransformerImpl.DaVinciRecordTransformerBootstrappingChangelogConsumer
java.lang.Object
com.linkedin.davinci.client.DaVinciRecordTransformer<K,V,V>
com.linkedin.davinci.consumer.BootstrappingVeniceChangelogConsumerDaVinciRecordTransformerImpl.DaVinciRecordTransformerBootstrappingChangelogConsumer
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- BootstrappingVeniceChangelogConsumerDaVinciRecordTransformerImpl<K,
V>
public class BootstrappingVeniceChangelogConsumerDaVinciRecordTransformerImpl.DaVinciRecordTransformerBootstrappingChangelogConsumer
extends DaVinciRecordTransformer<K,V,V>
-
Constructor Summary
ConstructorsConstructorDescriptionDaVinciRecordTransformerBootstrappingChangelogConsumer
(int storeVersion, org.apache.avro.Schema keySchema, org.apache.avro.Schema inputValueSchema, org.apache.avro.Schema outputValueSchema, DaVinciRecordTransformerConfig recordTransformerConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessageToBuffer
(K key, V value, int partitionId) void
close()
void
onStartVersionIngestion
(boolean isCurrentVersion) Lifecycle event triggered before consuming records forDaVinciRecordTransformer.storeVersion
.void
onVersionSwap
(int currentVersion, int futureVersion, int partitionId) void
processDelete
(Lazy<K> key, int partitionId) Override this method to customize the behavior for record deletions.void
processPut
(Lazy<K> key, Lazy<V> value, int partitionId) Implement this method to manage custom state outside the Da Vinci Client.Implement this method to transform records before they are stored.Methods inherited from class com.linkedin.davinci.client.DaVinciRecordTransformer
getAlwaysBootstrapFromVersionTopic, getClassHash, getInputValueSchema, getKeySchema, getOutputValueSchema, getRecordTransformerUtility, getStoreRecordsInDaVinci, getStoreVersion, onEndVersionIngestion, onRecovery, prependSchemaIdToHeader, prependSchemaIdToHeader, transformAndProcessPut, useUniformInputValueSchema
-
Constructor Details
-
DaVinciRecordTransformerBootstrappingChangelogConsumer
public DaVinciRecordTransformerBootstrappingChangelogConsumer(int storeVersion, org.apache.avro.Schema keySchema, org.apache.avro.Schema inputValueSchema, org.apache.avro.Schema outputValueSchema, DaVinciRecordTransformerConfig recordTransformerConfig)
-
-
Method Details
-
onStartVersionIngestion
public void onStartVersionIngestion(boolean isCurrentVersion) Description copied from class:DaVinciRecordTransformer
Lifecycle event triggered before consuming records forDaVinciRecordTransformer.storeVersion
. Use this method to perform setup operations such as opening database connections or creating tables. By default, it performs no operation.- Overrides:
onStartVersionIngestion
in classDaVinciRecordTransformer<K,
V, V>
-
transform
Description copied from class:DaVinciRecordTransformer
Implement this method to transform records before they are stored. This can be useful for tasks such as filtering out unused fields to save storage space.- Specified by:
transform
in classDaVinciRecordTransformer<K,
V, V> - Parameters:
key
- the key of the record to be transformedvalue
- the value of the record to be transformedpartitionId
- what partition the record came from- Returns:
DaVinciRecordTransformerResult
-
addMessageToBuffer
-
processPut
Description copied from class:DaVinciRecordTransformer
Implement this method to manage custom state outside the Da Vinci Client.- Specified by:
processPut
in classDaVinciRecordTransformer<K,
V, V> - Parameters:
key
- the key of the record to be putvalue
- the value of the record to be put, derived from the output ofDaVinciRecordTransformer.transform(Lazy key, Lazy value, int partitionId)
partitionId
- what partition the record came from
-
processDelete
Description copied from class:DaVinciRecordTransformer
Override this method to customize the behavior for record deletions. For example, you can use this method to delete records from a custom storage outside the Da Vinci Client. By default, it performs no operation.- Overrides:
processDelete
in classDaVinciRecordTransformer<K,
V, V> - Parameters:
key
- the key of the record to be deletedpartitionId
- what partition the record is being deleted from
-
onVersionSwap
public void onVersionSwap(int currentVersion, int futureVersion, int partitionId) -
close
- Throws:
IOException
-