Interface KafkaTools.InitialOffsetLookup

Enclosing class:
KafkaTools
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface KafkaTools.InitialOffsetLookup
Determines the initial offset to seek to for a given KafkaConsumer and TopicPartition.
  • Method Summary

    Modifier and Type
    Method
    Description
    adapt(IntToLongFunction intToLongFunction)
    Creates a implementation based solely on the topic partition.
    long
    getInitialOffset(org.apache.kafka.clients.consumer.KafkaConsumer<?,?> consumer, org.apache.kafka.common.TopicPartition topicPartition)
    Returns the initial offset that the consumer should start from for a given topicPartition.
  • Method Details

    • adapt

      static KafkaTools.InitialOffsetLookup adapt(IntToLongFunction intToLongFunction)
      Creates a implementation based solely on the topic partition.
    • getInitialOffset

      long getInitialOffset(org.apache.kafka.clients.consumer.KafkaConsumer<?,?> consumer, org.apache.kafka.common.TopicPartition topicPartition)
      Returns the initial offset that the consumer should start from for a given topicPartition.
      • -1L, seek to the beginning
      • -2L, don't seek
      • -3L, seek to the end
      Parameters:
      consumer - the consumer
      topicPartition - the topic partition
      Returns:
      the initial
      See Also: