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 PubSubTopic
destinationIdentifier()
N.B.: Used for defensive coding.void
notifyOfTopicDeletion(java.lang.String topicName)
long
receivedRecordsCount()
java.lang.String
toString()
void
write(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: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<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: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<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:
notifyOfTopicDeletion
in 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:
toString
in classjava.lang.Object
-
-