Class PatternTopicFilter

All Implemented Interfaces:
Serializable, TopicFilter

public class PatternTopicFilter extends Object implements TopicFilter
Filter that returns all partitions for topics matching the given Pattern.
See Also:
  • Constructor Details

    • PatternTopicFilter

      public PatternTopicFilter(Pattern pattern)
      Creates filter based on a Pattern. Only topic names matching the Pattern are passed by the filter.
      pattern - The Pattern to use.
  • Method Details

    • getAllSubscribedPartitions

      public Set<org.apache.kafka.common.TopicPartition> getAllSubscribedPartitions(org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
      Description copied from interface: TopicFilter
      Get the Kafka TopicPartitions subscribed to by this set of spouts.
      Specified by:
      getAllSubscribedPartitions in interface TopicFilter
      consumer - The Kafka consumer to use to read the list of existing partitions
      The Kafka partitions this set of spouts should subscribe to
    • getTopicsString

      public String getTopicsString()
      Description copied from interface: TopicFilter
      Get the topics string.
      Specified by:
      getTopicsString in interface TopicFilter
      A human-readable string representing the topics that pass the filter.
    • getTopicsPattern

      public String getTopicsPattern()