@VisibleForTesting public static class KafkaSourceEnumerator.PartitionOffsetsRetrieverImpl extends Object implements OffsetsInitializer.PartitionOffsetsRetriever, AutoCloseable
Constructor and Description |
---|
PartitionOffsetsRetrieverImpl(org.apache.kafka.clients.admin.AdminClient adminClient,
String groupId) |
Modifier and Type | Method and Description |
---|---|
Map<org.apache.kafka.common.TopicPartition,Long> |
beginningOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)
List beginning offsets for the specified partitions.
|
void |
close() |
Map<org.apache.kafka.common.TopicPartition,Long> |
committedOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)
The group id should be the set for
KafkaSource before 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.
|
public PartitionOffsetsRetrieverImpl(org.apache.kafka.clients.admin.AdminClient adminClient, String groupId)
public Map<org.apache.kafka.common.TopicPartition,Long> committedOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)
OffsetsInitializer.PartitionOffsetsRetriever
KafkaSource
before invoking this
method. Otherwise an IllegalStateException
will be thrown.committedOffsets
in interface OffsetsInitializer.PartitionOffsetsRetriever
KafkaAdminClient.listConsumerGroupOffsets(String, ListConsumerGroupOffsetsOptions)
public Map<org.apache.kafka.common.TopicPartition,Long> endOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)
OffsetsInitializer.PartitionOffsetsRetriever
endOffsets
in interface OffsetsInitializer.PartitionOffsetsRetriever
public Map<org.apache.kafka.common.TopicPartition,Long> beginningOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions)
OffsetsInitializer.PartitionOffsetsRetriever
beginningOffsets
in interface OffsetsInitializer.PartitionOffsetsRetriever
public Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndTimestamp> offsetsForTimes(Map<org.apache.kafka.common.TopicPartition,Long> timestampsToSearch)
OffsetsInitializer.PartitionOffsetsRetriever
offsetsForTimes
in interface OffsetsInitializer.PartitionOffsetsRetriever
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.