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)
Subscription
Subscribe 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 Subscription
consumer
- the Consumer to get.listener
- the rebalance listener to include in the subscriptionpublic void refreshAssignment()
Subscription
NOOP 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 Subscription
public String getTopicsString()
getTopicsString
in class Subscription
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.