public class NamedTopicFilter extends Object implements TopicFilter
Filter that returns all partitions for the specified topics.
Constructor and Description |
---|
NamedTopicFilter(Set<String> topics)
Create filter based on a set of topic names.
|
NamedTopicFilter(String... topics)
Convenience constructor.
|
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 |
getTopicsString()
Get the topics string.
|
public NamedTopicFilter(Set<String> topics)
Create filter based on a set of topic names.
topics
- The topic names the filter will pass.public NamedTopicFilter(String... topics)
Convenience constructor.
topics
- The topic names the filter will pass.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
Copyright © 2022 The Apache Software Foundation. All rights reserved.