Class StorePartitionDataReceiver
- java.lang.Object
-
- com.linkedin.davinci.kafka.consumer.StorePartitionDataReceiver
-
- All Implemented Interfaces:
ConsumedDataReceiver<java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>>>
public class StorePartitionDataReceiver extends java.lang.Object implements ConsumedDataReceiver<java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>>>
-
-
Constructor Summary
Constructors Constructor Description StorePartitionDataReceiver(StoreIngestionTask storeIngestionTask, PubSubTopicPartition topicPartition, java.lang.String kafkaUrl, int kafkaClusterId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PubSubTopicdestinationIdentifier()N.B.: Used for defensive coding.voidnotifyOfTopicDeletion(java.lang.String topicName)longreceivedRecordsCount()java.lang.StringtoString()voidwrite(java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> consumedData)This method accepts data consumed from a queue and it should be non-blocking.
-
-
-
Constructor Detail
-
StorePartitionDataReceiver
public StorePartitionDataReceiver(StoreIngestionTask storeIngestionTask, PubSubTopicPartition topicPartition, java.lang.String kafkaUrl, int kafkaClusterId)
-
-
Method Detail
-
write
public void write(java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> consumedData) throws java.lang.Exception
Description copied from interface:ConsumedDataReceiverThis 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:
writein interfaceConsumedDataReceiver<java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>>>- Parameters:
consumedData- Consumed data.- Throws:
java.lang.Exception
-
destinationIdentifier
public PubSubTopic destinationIdentifier()
Description copied from interface:ConsumedDataReceiverN.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:
destinationIdentifierin interfaceConsumedDataReceiver<java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>>>- Returns:
- an identifier of where the data is going.
-
notifyOfTopicDeletion
public void notifyOfTopicDeletion(java.lang.String topicName)
- Specified by:
notifyOfTopicDeletionin interfaceConsumedDataReceiver<java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>>>
-
receivedRecordsCount
public long receivedRecordsCount()
- Returns:
- Number of data records put in the receiver, for testing purpose.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-