Interface OffsetsInitializer.PartitionOffsetsRetriever
-
- All Known Implementing Classes:
KafkaSourceEnumerator.PartitionOffsetsRetrieverImpl
- Enclosing interface:
- OffsetsInitializer
public static interface OffsetsInitializer.PartitionOffsetsRetrieverAn interface that provides necessary information to theOffsetsInitializerto get the initial offsets of the Kafka partitions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<org.apache.kafka.common.TopicPartition,Long>beginningOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)List beginning offsets for the specified partitions.Map<org.apache.kafka.common.TopicPartition,Long>committedOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)The group id should be the set forKafkaSourcebefore invoking this method.Map<org.apache.kafka.common.TopicPartition,Long>endOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)List end offsets for the specified partitions.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndTimestamp>offsetsForTimes(Map<org.apache.kafka.common.TopicPartition,Long> timestampsToSearch)List offsets matching a timestamp for the specified partitions.
-
-
-
Method Detail
-
committedOffsets
Map<org.apache.kafka.common.TopicPartition,Long> committedOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)
The group id should be the set forKafkaSourcebefore invoking this method. Otherwise anIllegalStateExceptionwill be thrown.- Throws:
IllegalStateException- if the group id is not set for theKafkaSource.- See Also:
Admin.listConsumerGroupOffsets(String, ListConsumerGroupOffsetsOptions)
-
endOffsets
Map<org.apache.kafka.common.TopicPartition,Long> endOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)
List end offsets for the specified partitions.
-
beginningOffsets
Map<org.apache.kafka.common.TopicPartition,Long> beginningOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)
List beginning offsets for the specified partitions.
-
-