Class LeaderProducerCallback
- java.lang.Object
-
- com.linkedin.davinci.kafka.consumer.LeaderProducerCallback
-
- All Implemented Interfaces:
PubSubProducerCallback
,ChunkAwareCallback
- Direct Known Subclasses:
ActiveActiveProducerCallback
public class LeaderProducerCallback extends java.lang.Object implements ChunkAwareCallback
-
-
Field Summary
Fields Modifier and Type Field Description protected static ChunkedValueManifestSerializer
CHUNKED_VALUE_MANIFEST_SERIALIZER
protected ChunkedValueManifest
chunkedRmdManifest
protected static java.nio.ByteBuffer
EMPTY_BYTE_BUFFER
protected LeaderFollowerStoreIngestionTask
ingestionTask
protected LeaderProducedRecordContext
leaderProducedRecordContext
protected ChunkedValueManifest
oldRmdManifest
protected ChunkedValueManifest
oldValueManifest
-
Constructor Summary
Constructors Constructor Description LeaderProducerCallback(LeaderFollowerStoreIngestionTask ingestionTask, PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long> sourceConsumerRecord, PartitionConsumptionState partitionConsumptionState, LeaderProducedRecordContext leaderProducedRecordContext, int partition, java.lang.String kafkaUrl, long beforeProcessingRecordTimestampNs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LeaderFollowerStoreIngestionTask
getIngestionTask()
PartitionConsumptionState
getPartitionConsumptionState()
PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>
getSourceConsumerRecord()
protected Put
instantiateManifestPut()
protected Put
instantiateRmdChunkPut()
protected Put
instantiateValueChunkPut()
void
onCompletion(PubSubProduceResult produceResult, java.lang.Exception e)
exception will be null if request was completed without an error.void
setChunkingInfo(byte[] key, java.nio.ByteBuffer[] valueChunks, ChunkedValueManifest chunkedValueManifest, java.nio.ByteBuffer[] rmdChunks, ChunkedValueManifest chunkedRmdManifest, ChunkedValueManifest oldValueManifest, ChunkedValueManifest oldRmdManifest)
For all PUT operations, the {@param key} is guaranteed to be passed via this function, whether chunking is enabled or not, and whether the value is chunked or not.
-
-
-
Field Detail
-
CHUNKED_VALUE_MANIFEST_SERIALIZER
protected static final ChunkedValueManifestSerializer CHUNKED_VALUE_MANIFEST_SERIALIZER
-
EMPTY_BYTE_BUFFER
protected static final java.nio.ByteBuffer EMPTY_BYTE_BUFFER
-
ingestionTask
protected final LeaderFollowerStoreIngestionTask ingestionTask
-
leaderProducedRecordContext
protected final LeaderProducedRecordContext leaderProducedRecordContext
-
chunkedRmdManifest
protected ChunkedValueManifest chunkedRmdManifest
-
oldValueManifest
protected ChunkedValueManifest oldValueManifest
-
oldRmdManifest
protected ChunkedValueManifest oldRmdManifest
-
-
Constructor Detail
-
LeaderProducerCallback
public LeaderProducerCallback(LeaderFollowerStoreIngestionTask ingestionTask, PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long> sourceConsumerRecord, PartitionConsumptionState partitionConsumptionState, LeaderProducedRecordContext leaderProducedRecordContext, int partition, java.lang.String kafkaUrl, long beforeProcessingRecordTimestampNs)
-
-
Method Detail
-
onCompletion
public void onCompletion(PubSubProduceResult produceResult, java.lang.Exception e)
Description copied from interface:PubSubProducerCallback
exception will be null if request was completed without an error.- Specified by:
onCompletion
in interfacePubSubProducerCallback
-
setChunkingInfo
public void setChunkingInfo(byte[] key, java.nio.ByteBuffer[] valueChunks, ChunkedValueManifest chunkedValueManifest, java.nio.ByteBuffer[] rmdChunks, ChunkedValueManifest chunkedRmdManifest, ChunkedValueManifest oldValueManifest, ChunkedValueManifest oldRmdManifest)
Description copied from interface:ChunkAwareCallback
For all PUT operations, the {@param key} is guaranteed to be passed via this function, whether chunking is enabled or not, and whether the value is chunked or not. The other two parameters are null if the value is not chunked.- Specified by:
setChunkingInfo
in interfaceChunkAwareCallback
- Parameters:
key
- A byte[] corresponding to the top-level key written to Kafka, potentially including a chunking suffixvalueChunks
- An array ofByteBuffer
where the backing array has sufficient headroom to prepend Venice's headerchunkedValueManifest
- TheChunkedValueManifest
of the new chunked valuermdChunks
- An array ofByteBuffer
where the backing array has sufficient headroom to prepend Venice's headerchunkedRmdManifest
- TheChunkedValueManifest
of the new chunked RMDoldValueManifest
- TheChunkedValueManifest
of the previous chunked valueoldRmdManifest
- TheChunkedValueManifest
of the previous chunked RMD
-
instantiateValueChunkPut
protected Put instantiateValueChunkPut()
-
instantiateRmdChunkPut
protected Put instantiateRmdChunkPut()
-
instantiateManifestPut
protected Put instantiateManifestPut()
-
getPartitionConsumptionState
public PartitionConsumptionState getPartitionConsumptionState()
-
getSourceConsumerRecord
public PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long> getSourceConsumerRecord()
-
getIngestionTask
public LeaderFollowerStoreIngestionTask getIngestionTask()
-
-