@Internal public class NoStoppingOffsetsInitializer extends Object implements OffsetsInitializer
OffsetsInitializer which does not initialize anything.
This class is used as the default stopping offsets initializer for unbounded Kafka sources.
OffsetsInitializer.PartitionOffsetsRetriever| Constructor and Description |
|---|
NoStoppingOffsetsInitializer() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.kafka.clients.consumer.OffsetResetStrategy |
getAutoOffsetResetStrategy()
Get the auto offset reset strategy in case the initialized offsets falls out of the range.
|
Map<org.apache.kafka.common.TopicPartition,Long> |
getPartitionOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions,
OffsetsInitializer.PartitionOffsetsRetriever partitionOffsetsRetriever)
Get the initial offsets for the given Kafka partitions.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommittedOffsets, committedOffsets, earliest, latest, offsets, offsets, timestamppublic Map<org.apache.kafka.common.TopicPartition,Long> getPartitionOffsets(Collection<org.apache.kafka.common.TopicPartition> partitions, OffsetsInitializer.PartitionOffsetsRetriever partitionOffsetsRetriever)
OffsetsInitializerIf the implementation returns a starting offset which causes OffsetsOutOfRangeException from Kafka. The OffsetResetStrategy provided by the
OffsetsInitializer.getAutoOffsetResetStrategy() will be used to reset the offset.
getPartitionOffsets in interface OffsetsInitializerpartitions - the Kafka partitions to get the starting offsets.partitionOffsetsRetriever - a helper to retrieve information of the Kafka partitions.public org.apache.kafka.clients.consumer.OffsetResetStrategy getAutoOffsetResetStrategy()
OffsetsInitializerThe OffsetStrategy is only used when the offset initializer is used to initialize the starting offsets and the starting offsets is out of range.
getAutoOffsetResetStrategy in interface OffsetsInitializerOffsetResetStrategy to use if the initialized offsets are out of the
range.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.