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<List<org.apache.kafka.common.TopicPartition>,org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>, com.markosindustries.distroboy.core.operations.ListOp<List<org.apache.kafka.common.TopicPartition>,org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>, com.markosindustries.distroboy.core.operations.Operation<List<org.apache.kafka.common.TopicPartition>,org.apache.kafka.clients.consumer.ConsumerRecord<K,V>,List<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>>

public class ReadKafkaTopicPartitionRange<K,V> extends Object implements com.markosindustries.distroboy.core.operations.FlatMapOp<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(Map<String,Object> kafkaConfiguration, 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(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(Map<String,Object> kafkaConfiguration, KafkaOffsetSpec startOffsetInclusiveSpec, KafkaOffsetSpec endOffsetExclusiveSpec)
      Parameters:
      kafkaConfiguration - A Map of Configuration needed to instantiate 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(List<org.apache.kafka.common.TopicPartition> input)
      Specified by:
      flatMap in interface com.markosindustries.distroboy.core.operations.FlatMapOp<K,V>