Interface KafkaOffsetSpec

All Known Implementing Classes:
EarliestKafkaOffsetSpec, LatestKafkaOffsetSpec, TimestampKafkaOffsetSpec

public interface KafkaOffsetSpec
Specifies how to load offsets for a given set of Kafka partitions.
  • Method Summary

    Modifier and Type Method Description
    <K,​ V> java.util.Map<org.apache.kafka.common.TopicPartition,​java.lang.Long> getOffsets​(org.apache.kafka.clients.consumer.Consumer<K,​V> kafkaConsumer, java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
    Load the offsets for a given set of topicPartitions
  • Method Details

    • getOffsets

      <K,​ V> java.util.Map<org.apache.kafka.common.TopicPartition,​java.lang.Long> getOffsets​(org.apache.kafka.clients.consumer.Consumer<K,​V> kafkaConsumer, java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
      Load the offsets for a given set of topicPartitions
      Type Parameters:
      K - The type of keys the KafkaConsumer will deserialise
      V - The type of values the KafkaConsumer will deserialise
      Parameters:
      kafkaConsumer - A KafkaConsumer to communicate with Kafka via
      topicPartitions - The set of TopicPartitions to load offsets for
      Returns:
      A map from each TopicPartition specified to it's offset according to this Spec.