Class KafkaTopicPartitionsSource

java.lang.Object
com.markosindustries.distroboy.kafka.KafkaTopicPartitionsSource
All Implemented Interfaces:
com.markosindustries.distroboy.core.operations.DataSource<java.util.List<org.apache.kafka.common.TopicPartition>>, com.markosindustries.distroboy.core.operations.Operand<java.util.List<org.apache.kafka.common.TopicPartition>,​java.util.List<java.util.List<org.apache.kafka.common.TopicPartition>>>

public class KafkaTopicPartitionsSource
extends java.lang.Object
implements com.markosindustries.distroboy.core.operations.DataSource<java.util.List<org.apache.kafka.common.TopicPartition>>
A DataSource which will yield all TopicPartitions available on the Kafka cluster for a given set of topics.
  • Constructor Summary

    Constructors
    Constructor Description
    KafkaTopicPartitionsSource​(org.apache.kafka.clients.consumer.Consumer<?,​?> kafkaConsumer, java.util.Collection<java.lang.String> topics)  
  • Method Summary

    Modifier and Type Method Description
    long countOfFullSet()  
    com.markosindustries.distroboy.core.iterators.IteratorWithResources<java.util.List<org.apache.kafka.common.TopicPartition>> enumerateRangeOfFullSet​(long startInclusive, long endExclusive)  

    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.DataSource

    collect, dependencies, enumerateRangeForNode

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

    then
  • Constructor Details

    • KafkaTopicPartitionsSource

      public KafkaTopicPartitionsSource​(org.apache.kafka.clients.consumer.Consumer<?,​?> kafkaConsumer, java.util.Collection<java.lang.String> topics)
      Parameters:
      kafkaConsumer - A KafkaConsumer to communicate with Kafka via
      topics - The set of topics to retrieve TopicPartitions for
  • Method Details

    • countOfFullSet

      public long countOfFullSet()
      Specified by:
      countOfFullSet in interface com.markosindustries.distroboy.core.operations.DataSource<java.util.List<org.apache.kafka.common.TopicPartition>>
    • enumerateRangeOfFullSet

      public com.markosindustries.distroboy.core.iterators.IteratorWithResources<java.util.List<org.apache.kafka.common.TopicPartition>> enumerateRangeOfFullSet​(long startInclusive, long endExclusive)
      Specified by:
      enumerateRangeOfFullSet in interface com.markosindustries.distroboy.core.operations.DataSource<java.util.List<org.apache.kafka.common.TopicPartition>>