public class PatternTopicFilter extends Object implements TopicFilter
Filter that returns all partitions for topics matching the given Pattern
.
Constructor and Description |
---|
PatternTopicFilter(Pattern pattern)
Creates filter based on a Pattern.
|
Modifier and Type | Method and Description |
---|---|
Set<org.apache.kafka.common.TopicPartition> |
getAllSubscribedPartitions(org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Get the Kafka TopicPartitions subscribed to by this set of spouts.
|
String |
getTopicsPattern() |
String |
getTopicsString()
Get the topics string.
|
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.public Set<org.apache.kafka.common.TopicPartition> getAllSubscribedPartitions(org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
TopicFilter
Get the Kafka TopicPartitions subscribed to by this set of spouts.
getAllSubscribedPartitions
in interface TopicFilter
consumer
- The Kafka consumer to use to read the list of existing partitionspublic String getTopicsString()
TopicFilter
Get the topics string.
getTopicsString
in interface TopicFilter
public String getTopicsPattern()
Copyright © 2022 The Apache Software Foundation. All rights reserved.