Interface OffsetsInitializer.PartitionOffsetsRetriever
- All Known Implementing Classes:
KafkaSourceEnumerator.PartitionOffsetsRetrieverImpl
- Enclosing interface:
OffsetsInitializer
public static interface OffsetsInitializer.PartitionOffsetsRetriever
An interface that provides necessary information to the
OffsetsInitializer to get the
initial offsets of the Kafka partitions.-
Method Summary
Modifier and TypeMethodDescriptionbeginningOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions) List beginning offsets for the specified partitions.committedOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions) The group id should be the set forKafkaSourcebefore invoking this method.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 Details
-
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:
-
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. -
offsetsForTimes
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.
-