Class StorePartitionDataReceiver
java.lang.Object
com.linkedin.davinci.kafka.consumer.StorePartitionDataReceiver
- All Implemented Interfaces:
ConsumedDataReceiver<List<PubSubMessage<KafkaKey,
KafkaMessageEnvelope, Long>>>
public class StorePartitionDataReceiver
extends Object
implements ConsumedDataReceiver<List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,Long>>>
-
Constructor Summary
ConstructorDescriptionStorePartitionDataReceiver
(StoreIngestionTask storeIngestionTask, PubSubTopicPartition topicPartition, String kafkaUrl, int kafkaClusterId) -
Method Summary
Modifier and TypeMethodDescriptionN.B.: Used for defensive coding.void
notifyOfTopicDeletion
(String topicName) long
toString()
void
write
(List<PubSubMessage<KafkaKey, KafkaMessageEnvelope, Long>> consumedData) This method accepts data consumed from a queue and it should be non-blocking.
-
Constructor Details
-
StorePartitionDataReceiver
public StorePartitionDataReceiver(StoreIngestionTask storeIngestionTask, PubSubTopicPartition topicPartition, String kafkaUrl, int kafkaClusterId)
-
-
Method Details
-
write
public void write(List<PubSubMessage<KafkaKey, KafkaMessageEnvelope, throws ExceptionLong>> consumedData) Description copied from interface:ConsumedDataReceiver
This method accepts data consumed from a queue and it should be non-blocking. This method may throw an exception if write is not successful. No exception being thrown means write is successful.- Specified by:
write
in interfaceConsumedDataReceiver<List<PubSubMessage<KafkaKey,
KafkaMessageEnvelope, Long>>> - Parameters:
consumedData
- Consumed data.- Throws:
Exception
-
destinationIdentifier
Description copied from interface:ConsumedDataReceiver
N.B.: Used for defensive coding. Today, this is exclusively used to return the version-topic name. If this is to be expanded to other usages in the future, we should consider carefully if it needs refactoring.- Specified by:
destinationIdentifier
in interfaceConsumedDataReceiver<List<PubSubMessage<KafkaKey,
KafkaMessageEnvelope, Long>>> - Returns:
- an identifier of where the data is going.
-
notifyOfTopicDeletion
- Specified by:
notifyOfTopicDeletion
in interfaceConsumedDataReceiver<List<PubSubMessage<KafkaKey,
KafkaMessageEnvelope, Long>>>
-
receivedRecordsCount
public long receivedRecordsCount()- Returns:
- Number of data records put in the receiver, for testing purpose.
-
toString
-