Package com.linkedin.davinci.client
Class DaVinciRecordTransformerConfig.Builder
java.lang.Object
com.linkedin.davinci.client.DaVinciRecordTransformerConfig.Builder
- Enclosing class:
- DaVinciRecordTransformerConfig
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()setAlwaysBootstrapFromVersionTopic(boolean alwaysBootstrapFromVersionTopic) Set this to true ifstoreRecordsInDaVinciis 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 inDaVinciRecordTransformerRecordMetadatawill 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- 
Builderpublic Builder()
 
- 
- 
Method Details- 
setRecordTransformerFunctionpublic 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
 
- 
setKeyClassOptional. Set this if you want to deserialize keys intoSpecificRecord.- Parameters:
- keyClass- the class of the key
 
- 
setOutputValueClassOptional. 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
 
- 
setOutputValueSchemapublic 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
 
- 
setStoreRecordsInDaVincipublic 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
 
- 
setAlwaysBootstrapFromVersionTopicpublic DaVinciRecordTransformerConfig.Builder setAlwaysBootstrapFromVersionTopic(boolean alwaysBootstrapFromVersionTopic) Set this to true ifstoreRecordsInDaVinciis 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
 
- 
setRecordTransformationEnabledpublic 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
 
- 
setRecordMetadataEnabledpublic DaVinciRecordTransformerConfig.Builder setRecordMetadataEnabled(boolean recordMetadataEnabled) When enabled, the fields inDaVinciRecordTransformerRecordMetadatawill be populated and passed toDaVinciRecordTransformer.transform(Lazy, Lazy, int, DaVinciRecordTransformerRecordMetadata)andDaVinciRecordTransformer.processPut(Lazy, Lazy, int, DaVinciRecordTransformerRecordMetadata). Default is false;
- 
build
 
-