Package com.linkedin.davinci.client
Class DaVinciRecordTransformerConfig.Builder
java.lang.Object
com.linkedin.davinci.client.DaVinciRecordTransformerConfig.Builder
- Enclosing class:
- DaVinciRecordTransformerConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
setAlwaysBootstrapFromVersionTopic
(boolean alwaysBootstrapFromVersionTopic) Set this to true ifstoreRecordsInDaVinci
is false, and you're storing records in memory without being backed by disk.setKeyClass
(Class keyClass) Optional.setOutputValueClass
(Class outputValueClass) Optional.setOutputValueSchema
(org.apache.avro.Schema outputValueSchema) Optional.setRecordMetadataEnabled
(boolean recordMetadataEnabled) When enabled, the fields inDaVinciRecordTransformerRecordMetadata
will be populated and passed toDaVinciRecordTransformer.transform(Lazy, Lazy, int, DaVinciRecordTransformerRecordMetadata)
andDaVinciRecordTransformer.processPut(Lazy, Lazy, int, DaVinciRecordTransformerRecordMetadata)
.setRecordTransformationEnabled
(boolean recordTransformationEnabled) Set this to false if you are not modifying record values inDaVinciRecordTransformer.transform(com.linkedin.venice.utils.lazy.Lazy<K>, com.linkedin.venice.utils.lazy.Lazy<V>, int, com.linkedin.davinci.client.DaVinciRecordTransformerRecordMetadata)
.setRecordTransformerFunction
(DaVinciRecordTransformerFunctionalInterface recordTransformerFunction) Required for creating aDaVinciRecordTransformer
.setStoreRecordsInDaVinci
(boolean storeRecordsInDaVinci) Control whether records are persisted into Da Vinci's local disk.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setRecordTransformerFunction
public DaVinciRecordTransformerConfig.Builder setRecordTransformerFunction(DaVinciRecordTransformerFunctionalInterface recordTransformerFunction) Required for creating aDaVinciRecordTransformer
. The function is invoked with the store version at startup.- Parameters:
recordTransformerFunction
- functional interface that constructs the transformer
-
setKeyClass
Optional. Set this if you want to deserialize keys intoSpecificRecord
.- Parameters:
keyClass
- the class of the key
-
setOutputValueClass
Optional. Set when you change the value type/schema or when values should be deserialized intoSpecificRecord
. Must be used withsetOutputValueSchema(Schema)
.- Parameters:
outputValueClass
- the class of the output value
-
setOutputValueSchema
public DaVinciRecordTransformerConfig.Builder setOutputValueSchema(org.apache.avro.Schema outputValueSchema) Optional. Set when you change the value type/schema or when values should be deserialized intoSpecificRecord
. Must be used withsetOutputValueClass(Class)
.- Parameters:
outputValueSchema
- the schema of the output value
-
setStoreRecordsInDaVinci
public DaVinciRecordTransformerConfig.Builder setStoreRecordsInDaVinci(boolean storeRecordsInDaVinci) Control whether records are persisted into Da Vinci's local disk. Set to false to route writes only to your own storage via transformer callback. It's not recommended to set this to false, as you will not be able to leverage blob transfer, impacting bootstrapping time. Default is true.- Parameters:
storeRecordsInDaVinci
- whether to store records in Da Vinci
-
setAlwaysBootstrapFromVersionTopic
public DaVinciRecordTransformerConfig.Builder setAlwaysBootstrapFromVersionTopic(boolean alwaysBootstrapFromVersionTopic) Set this to true ifstoreRecordsInDaVinci
is false, and you're storing records in memory without being backed by disk. Default is false.- Parameters:
alwaysBootstrapFromVersionTopic
- whether to always bootstrap from the Version Topic
-
setRecordTransformationEnabled
public DaVinciRecordTransformerConfig.Builder setRecordTransformationEnabled(boolean recordTransformationEnabled) Set this to false if you are not modifying record values inDaVinciRecordTransformer.transform(com.linkedin.venice.utils.lazy.Lazy<K>, com.linkedin.venice.utils.lazy.Lazy<V>, int, com.linkedin.davinci.client.DaVinciRecordTransformerRecordMetadata)
. If records aren't being transformed but this remains true, deserialization issues may occur during recovery after restart when the value schema has evolved. Default is true.- Parameters:
recordTransformationEnabled
- whether records are being transformed
-
setRecordMetadataEnabled
public DaVinciRecordTransformerConfig.Builder setRecordMetadataEnabled(boolean recordMetadataEnabled) When enabled, the fields inDaVinciRecordTransformerRecordMetadata
will be populated and passed toDaVinciRecordTransformer.transform(Lazy, Lazy, int, DaVinciRecordTransformerRecordMetadata)
andDaVinciRecordTransformer.processPut(Lazy, Lazy, int, DaVinciRecordTransformerRecordMetadata)
. Default is false; -
build
-