Package com.linkedin.davinci.store.view
Class ChangeCaptureViewWriter
- java.lang.Object
-
- com.linkedin.venice.views.VeniceView
-
- com.linkedin.davinci.store.view.VeniceViewWriter
-
- com.linkedin.davinci.store.view.ChangeCaptureViewWriter
-
public class ChangeCaptureViewWriter extends VeniceViewWriter
-
-
Field Summary
-
Fields inherited from class com.linkedin.venice.views.VeniceView
props, store, VIEW_TOPIC_SEPARATOR, viewParameters
-
-
Constructor Summary
Constructors Constructor Description ChangeCaptureViewWriter(VeniceConfigLoader props, Store store, org.apache.avro.Schema keySchema, java.util.Map<java.lang.String,java.lang.String> extraViewParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.util.Map<java.lang.String,VeniceProperties>
getTopicNamesAndConfigsForVersion(int version)
Implementations should override to return a map of topicName:topic Configs relevant for topic materialization (things like partition count, RF, etc.) TODO: Come up with list of config names that should be parsed by VeniceAdmin to pass along to TopicManager.java.lang.String
getWriterClassName()
Implementations should return the fully specified class name for the component VeniceViewWriter implementation.void
processControlMessage(ControlMessage controlMessage, int partition, PartitionConsumptionState partitionConsumptionState, int version)
Called when the server encounters a control message.java.util.concurrent.CompletableFuture<PubSubProduceResult>
processRecord(java.nio.ByteBuffer newValue, java.nio.ByteBuffer oldValue, byte[] key, int version, int newValueSchemaId, int oldValueSchemaId, org.apache.avro.generic.GenericRecord replicationMetadataRecord)
To be called as a given ingestion task consumes each record.-
Methods inherited from class com.linkedin.venice.views.VeniceView
isViewTopic, parseStoreFromViewTopic, parseVersionFromViewTopic, validateConfigs
-
-
-
-
Constructor Detail
-
ChangeCaptureViewWriter
public ChangeCaptureViewWriter(VeniceConfigLoader props, Store store, org.apache.avro.Schema keySchema, java.util.Map<java.lang.String,java.lang.String> extraViewParameters)
-
-
Method Detail
-
processRecord
public java.util.concurrent.CompletableFuture<PubSubProduceResult> processRecord(java.nio.ByteBuffer newValue, java.nio.ByteBuffer oldValue, byte[] key, int version, int newValueSchemaId, int oldValueSchemaId, org.apache.avro.generic.GenericRecord replicationMetadataRecord)
Description copied from class:VeniceViewWriter
To be called as a given ingestion task consumes each record. This is called prior to writing to a VT or to persistent storage.- Overrides:
processRecord
in classVeniceViewWriter
- Parameters:
newValue
- the incoming fully specified value which hasn't yet been committed to VeniceoldValue
- the previous value which has already been locally committed to Venice for the given keykey
- the key of the record that designates newValue and oldValueversion
- the version of the store taking this recordnewValueSchemaId
- the schemaId of the incoming recordoldValueSchemaId
- the schemaId of the old recordreplicationMetadataRecord
- the associated RMD for the incoming record.
-
processControlMessage
public void processControlMessage(ControlMessage controlMessage, int partition, PartitionConsumptionState partitionConsumptionState, int version)
Description copied from class:VeniceViewWriter
Called when the server encounters a control message. There isn't (today) a strict ordering on if the rest of the server alters it's state completely or not based on the incoming control message relative to the given view. TODO: Today this is only invoked for VERSION_SWAP control message, but we may in the future call this method for all control messages so that certain view types can act accordingly.- Overrides:
processControlMessage
in classVeniceViewWriter
- Parameters:
controlMessage
- the control message we're processingpartition
- the partition this control message was delivered topartitionConsumptionState
- the pcs of the consuming nodeversion
- the store version that received this message
-
getTopicNamesAndConfigsForVersion
public java.util.Map<java.lang.String,VeniceProperties> getTopicNamesAndConfigsForVersion(int version)
Description copied from class:VeniceView
Implementations should override to return a map of topicName:topic Configs relevant for topic materialization (things like partition count, RF, etc.) TODO: Come up with list of config names that should be parsed by VeniceAdmin to pass along to TopicManager.- Overrides:
getTopicNamesAndConfigsForVersion
in classVeniceView
- Returns:
- a map keyed by the name of the topic to be created and the configs which should be applied for that creation
-
getWriterClassName
public java.lang.String getWriterClassName()
Description copied from class:VeniceView
Implementations should return the fully specified class name for the component VeniceViewWriter implementation.- Overrides:
getWriterClassName
in classVeniceView
- Returns:
- returns the className of the writer which should be instantiated.
-
close
public void close()
- Overrides:
close
in classVeniceView
-
-