Class ReadKafkaTopicPartitionRange<K,​V>

java.lang.Object
com.markosindustries.distroboy.kafka.ReadKafkaTopicPartitionRange<K,​V>
Type Parameters:
K - The type of keys the KafkaConsumer will deserialise
V - The type of values the KafkaConsumer will deserialise
All Implemented Interfaces:
com.markosindustries.distroboy.core.operations.FlatMapOp<java.util.List<org.apache.kafka.common.TopicPartition>,​org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>>, com.markosindustries.distroboy.core.operations.ListOp<java.util.List<org.apache.kafka.common.TopicPartition>,​org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>>, com.markosindustries.distroboy.core.operations.Operation<java.util.List<org.apache.kafka.common.TopicPartition>,​org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>,​java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>>>

public class ReadKafkaTopicPartitionRange<K,​V>
extends java.lang.Object
implements com.markosindustries.distroboy.core.operations.FlatMapOp<java.util.List<org.apache.kafka.common.TopicPartition>,​org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>>
FlatMap a given set of TopicPartitions by loading all records from the starting offsets (inclusive) to the ending offsets (exclusive) specified.
  • Constructor Summary

    Constructors
    Constructor Description
    ReadKafkaTopicPartitionRange​(org.apache.kafka.clients.consumer.Consumer<K,​V> kafkaConsumer, KafkaOffsetSpec startOffsetInclusiveSpec, KafkaOffsetSpec endOffsetExclusiveSpec)  
  • Method Summary

    Modifier and Type Method Description
    com.markosindustries.distroboy.core.iterators.IteratorWithResources<org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>> flatMap​(java.util.List<org.apache.kafka.common.TopicPartition> input)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.markosindustries.distroboy.core.operations.FlatMapOp

    apply

    Methods inherited from interface com.markosindustries.distroboy.core.operations.ListOp

    collect
  • Constructor Details

    • ReadKafkaTopicPartitionRange

      public ReadKafkaTopicPartitionRange​(org.apache.kafka.clients.consumer.Consumer<K,​V> kafkaConsumer, KafkaOffsetSpec startOffsetInclusiveSpec, KafkaOffsetSpec endOffsetExclusiveSpec)
      Parameters:
      kafkaConsumer - A KafkaConsumer to communicate with Kafka via
      startOffsetInclusiveSpec - The starting offset spec (inclusive)
      endOffsetExclusiveSpec - The end offset spec (exclusive)
  • Method Details

    • flatMap

      public com.markosindustries.distroboy.core.iterators.IteratorWithResources<org.apache.kafka.clients.consumer.ConsumerRecord<K,​V>> flatMap​(java.util.List<org.apache.kafka.common.TopicPartition> input)
      Specified by:
      flatMap in interface com.markosindustries.distroboy.core.operations.FlatMapOp<K,​V>