Class StaticOffsetsSpec
java.lang.Object
com.markosindustries.distroboy.kafka.StaticOffsetsSpec
- All Implemented Interfaces:
KafkaOffsetSpec
-
Constructor Summary
ConstructorsConstructorDescriptionStaticOffsetsSpec
(Map<org.apache.kafka.common.TopicPartition, Long> staticOffsets) -
Method Summary
Modifier and TypeMethodDescriptiongetOffsets
(org.apache.kafka.clients.consumer.Consumer<K, V> kafkaConsumer, Collection<org.apache.kafka.common.TopicPartition> topicPartitions) Load the offsets for a given set of topicPartitions
-
Constructor Details
-
StaticOffsetsSpec
-
-
Method Details
-
getOffsets
public <K,V> Map<org.apache.kafka.common.TopicPartition,Long> getOffsets(org.apache.kafka.clients.consumer.Consumer<K, V> kafkaConsumer, Collection<org.apache.kafka.common.TopicPartition> topicPartitions) Description copied from interface:KafkaOffsetSpec
Load the offsets for a given set of topicPartitions- Specified by:
getOffsets
in interfaceKafkaOffsetSpec
- Type Parameters:
K
- The type of keys theKafkaConsumer
will deserialiseV
- The type of values theKafkaConsumer
will deserialise- Parameters:
kafkaConsumer
- AKafkaConsumer
to communicate with Kafka viatopicPartitions
- The set ofTopicPartition
s to load offsets for- Returns:
- A map from each TopicPartition specified to it's offset according to this Spec.
-