Class NamedTopicFilter
java.lang.Object
org.apache.storm.kafka.spout.subscription.NamedTopicFilter
- All Implemented Interfaces:
Serializable
,TopicFilter
Filter that returns all partitions for the specified topics.
- See Also:
-
Constructor Summary
ConstructorDescriptionNamedTopicFilter
(String... topics) Convenience constructor.NamedTopicFilter
(Set<String> topics) Create filter based on a set of topic names. -
Method Summary
Modifier and TypeMethodDescriptionSet<org.apache.kafka.common.TopicPartition>
getAllSubscribedPartitions
(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer) Get the Kafka TopicPartitions subscribed to by this set of spouts.Get the topics string.
-
Constructor Details
-
NamedTopicFilter
Create filter based on a set of topic names.- Parameters:
topics
- The topic names the filter will pass.
-
NamedTopicFilter
Convenience constructor.- Parameters:
topics
- The topic names the filter will pass.
-
-
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 interfaceTopicFilter
- Parameters:
consumer
- The Kafka consumer to use to read the list of existing partitions- Returns:
- The Kafka partitions this set of spouts should subscribe to
-
getTopicsString
Description copied from interface:TopicFilter
Get the topics string.- Specified by:
getTopicsString
in interfaceTopicFilter
- Returns:
- A human-readable string representing the topics that pass the filter.
-