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 ofDaVinciRecordTransformer
that implements blocking. It ensures that no puts can proceed until onStartIngestionTask finishes.
-
-
Constructor Summary
Constructors Constructor Description BlockingDaVinciRecordTransformer(DaVinciRecordTransformer recordTransformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description O
delete(Lazy<K> key)
By default, deletes will proceed.org.apache.avro.Schema
getKeyOutputSchema()
This will be the type returned by theDaVinciClient
's read operations.org.apache.avro.Schema
getValueOutputSchema()
void
onEndIngestionTask()
This function is called as a lifecycle event at the end of an ingestion task By default, it performs no operation.void
onStartIngestionTask()
This function is called as a lifecycle event at the beginning of an ingestion task.O
put(Lazy<K> key, Lazy<V> value)
-
Methods inherited from class com.linkedin.davinci.client.DaVinciRecordTransformer
getStoreVersion, getValueBytes
-
-
-
-
Constructor Detail
-
BlockingDaVinciRecordTransformer
public BlockingDaVinciRecordTransformer(DaVinciRecordTransformer recordTransformer)
-
-
Method Detail
-
getKeyOutputSchema
public org.apache.avro.Schema getKeyOutputSchema()
Description copied from class:DaVinciRecordTransformer
This will be the type returned by theDaVinciClient
's read operations.- Specified by:
getKeyOutputSchema
in classDaVinciRecordTransformer<K,V,O>
- Returns:
- a
Schema
corresponding to the type ofDaVinciRecordTransformer
.
-
getValueOutputSchema
public org.apache.avro.Schema getValueOutputSchema()
- Specified by:
getValueOutputSchema
in classDaVinciRecordTransformer<K,V,O>
-
put
public O put(Lazy<K> key, Lazy<V> value)
- Specified by:
put
in classDaVinciRecordTransformer<K,V,O>
- Parameters:
key
- to be putvalue
- to be put- Returns:
- the object to keep in storage, or null if the put should be skipped
-
delete
public O delete(Lazy<K> key)
Description copied from class:DaVinciRecordTransformer
By default, deletes will proceed. This can be overridden if some deleted records should be kept.- Overrides:
delete
in classDaVinciRecordTransformer<K,V,O>
- Parameters:
key
- to be deleted- Returns:
- the object to keep in storage, or null to proceed with the deletion
-
onStartIngestionTask
public void onStartIngestionTask()
Description copied from class:DaVinciRecordTransformer
This function is called as a lifecycle event at the beginning of an ingestion task. By default, it performs no operation.- Overrides:
onStartIngestionTask
in classDaVinciRecordTransformer<K,V,O>
-
onEndIngestionTask
public void onEndIngestionTask()
Description copied from class:DaVinciRecordTransformer
This function is called as a lifecycle event at the end of an ingestion task By default, it performs no operation.- Overrides:
onEndIngestionTask
in classDaVinciRecordTransformer<K,V,O>
-
-