Package com.linkedin.davinci.client
Class BlockingDaVinciRecordTransformer<K,V,O>
- java.lang.Object
-
- com.linkedin.davinci.client.DaVinciRecordTransformer<K,V,O>
-
- com.linkedin.davinci.client.BlockingDaVinciRecordTransformer<K,V,O>
-
- Type Parameters:
K- type of the input keyV- type of the input valueO- type of the output value
@Experimental public class BlockingDaVinciRecordTransformer<K,V,O> extends DaVinciRecordTransformer<K,V,O>
This is an implementation ofDaVinciRecordTransformerthat implements blocking. It ensures that no puts can proceed until onStartIngestionTask finishes.
-
-
Constructor Summary
Constructors Constructor Description BlockingDaVinciRecordTransformer(DaVinciRecordTransformer recordTransformer, boolean storeRecordsInDaVinci)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.avro.SchemagetKeySchema()Returns the schema for the key used inDaVinciClient's operations.org.apache.avro.SchemagetOutputValueSchema()Returns the schema for the output value used inDaVinciClient's operations.voidonEndVersionIngestion()Lifecycle event triggered when record consumption is stopped forDaVinciRecordTransformer.storeVersion.voidonStartVersionIngestion()Lifecycle event triggered before consuming records forDaVinciRecordTransformer.storeVersion.voidprocessDelete(Lazy<K> key)Override this method to customize the behavior for record deletions.voidprocessPut(Lazy<K> key, Lazy<O> value)Implement this method to manage custom state outside the Da Vinci Client.DaVinciRecordTransformerResult<O>transform(Lazy<K> key, Lazy<V> value)Implement this method to transform records before they are stored.-
Methods inherited from class com.linkedin.davinci.client.DaVinciRecordTransformer
getClassHash, getRecordTransformerUtility, getStoreRecordsInDaVinci, getStoreVersion, onRecovery, prependSchemaIdToHeader, prependSchemaIdToHeader, transformAndProcessPut
-
-
-
-
Constructor Detail
-
BlockingDaVinciRecordTransformer
public BlockingDaVinciRecordTransformer(DaVinciRecordTransformer recordTransformer, boolean storeRecordsInDaVinci)
-
-
Method Detail
-
getKeySchema
public org.apache.avro.Schema getKeySchema()
Description copied from class:DaVinciRecordTransformerReturns the schema for the key used inDaVinciClient's operations.- Specified by:
getKeySchemain classDaVinciRecordTransformer<K,V,O>- Returns:
- a
Schemacorresponding to the type ofDaVinciRecordTransformer.
-
getOutputValueSchema
public org.apache.avro.Schema getOutputValueSchema()
Description copied from class:DaVinciRecordTransformerReturns the schema for the output value used inDaVinciClient's operations.- Specified by:
getOutputValueSchemain classDaVinciRecordTransformer<K,V,O>- Returns:
- a
Schemacorresponding to the type ofDaVinciRecordTransformer.
-
transform
public DaVinciRecordTransformerResult<O> transform(Lazy<K> key, Lazy<V> value)
Description copied from class:DaVinciRecordTransformerImplement 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:
transformin classDaVinciRecordTransformer<K,V,O>- Parameters:
key- the key of the record to be transformedvalue- the value of the record to be transformed- Returns:
DaVinciRecordTransformerResult
-
processPut
public void processPut(Lazy<K> key, Lazy<O> value)
Description copied from class:DaVinciRecordTransformerImplement this method to manage custom state outside the Da Vinci Client.- Specified by:
processPutin classDaVinciRecordTransformer<K,V,O>- 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)
-
processDelete
public void processDelete(Lazy<K> key)
Description copied from class:DaVinciRecordTransformerOverride 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:
processDeletein classDaVinciRecordTransformer<K,V,O>- Parameters:
key- the key of the record to be deleted
-
onStartVersionIngestion
public void onStartVersionIngestion()
Description copied from class:DaVinciRecordTransformerLifecycle 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:
onStartVersionIngestionin classDaVinciRecordTransformer<K,V,O>
-
onEndVersionIngestion
public void onEndVersionIngestion()
Description copied from class:DaVinciRecordTransformerLifecycle event triggered when record consumption is stopped forDaVinciRecordTransformer.storeVersion. Use this method to perform cleanup operations such as closing database connections or dropping tables. By default, it performs no operation.- Overrides:
onEndVersionIngestionin classDaVinciRecordTransformer<K,V,O>
-
-