public class ManualPartitionSubscription extends Subscription
| Constructor and Description |
|---|
ManualPartitionSubscription(ManualPartitioner parter,
TopicFilter partitionFilter) |
| Modifier and Type | Method and Description |
|---|---|
String |
getTopicsString() |
void |
refreshAssignment()
NOOP is the default behavior, which means that Kafka will internally handle partition assignment.
|
<K,V> void |
subscribe(org.apache.kafka.clients.consumer.KafkaConsumer<K,V> consumer,
org.apache.kafka.clients.consumer.ConsumerRebalanceListener listener,
TopologyContext context)
Subscribe the KafkaConsumer to the proper topics.
|
public ManualPartitionSubscription(ManualPartitioner parter, TopicFilter partitionFilter)
public <K,V> void subscribe(org.apache.kafka.clients.consumer.KafkaConsumer<K,V> consumer,
org.apache.kafka.clients.consumer.ConsumerRebalanceListener listener,
TopologyContext context)
SubscriptionSubscribe the KafkaConsumer to the proper topics. Implementations must ensure that a given topic partition is always assigned to the same spout task. Adding and removing partitions as necessary is fine, but partitions must not move from one task to another. This constraint is only important for use with the Trident spout.
subscribe in class Subscriptionconsumer - the Consumer to get.listener - the rebalance listener to include in the subscriptionpublic void refreshAssignment()
SubscriptionNOOP is the default behavior, which means that Kafka will internally handle partition assignment. If you wish to do manual partition management, you must provide an implementation of this method that will check with kafka for any changes and call the ConsumerRebalanceListener from subscribe to inform the rest of the system of those changes.
refreshAssignment in class Subscriptionpublic String getTopicsString()
getTopicsString in class SubscriptionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.