Interface ConsumedDataReceiver<MESSAGE>

  • Type Parameters:
    MESSAGE - Type of consumed data. For example, in the Kafka case, this type could be ConsumerRecords
    All Known Implementing Classes:
    StorePartitionDataReceiver

    public interface ConsumedDataReceiver<MESSAGE>
    An abstraction of a receiver of data consumed from a message queue. In other words, its an abstraction that accepts data consumed from a message queue. Note that it is NOT thread-safe. This abstraction may be converted to a more explicit partition buffer interface when we introduce the partition buffer interface to avoid potential confusion.
    • Method Detail

      • write

        void write​(MESSAGE consumedData)
            throws java.lang.Exception
        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.
        Parameters:
        consumedData - Consumed data.
        Throws:
        java.lang.Exception
      • destinationIdentifier

        PubSubTopic destinationIdentifier()
        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.
        Returns:
        an identifier of where the data is going.
      • notifyOfTopicDeletion

        void notifyOfTopicDeletion​(java.lang.String topicName)