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 |
|---|---|
List<org.apache.kafka.common.TopicPartition> |
getFilteredTopicPartitions(org.apache.kafka.clients.consumer.KafkaConsumer<?,?> consumer)
Get the Kafka TopicPartitions passed by this filter.
|
String |
getTopicsPattern() |
String |
getTopicsString() |
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 List<org.apache.kafka.common.TopicPartition> getFilteredTopicPartitions(org.apache.kafka.clients.consumer.KafkaConsumer<?,?> consumer)
TopicFilterGet the Kafka TopicPartitions passed by this filter.
getFilteredTopicPartitions in interface TopicFilterconsumer - The Kafka consumer to use to read the list of existing partitionspublic String getTopicsString()
getTopicsString in interface TopicFilterpublic String getTopicsPattern()
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.