Github user hmcl commented on a diff in the pull request:
https://github.com/apache/storm/pull/2147#discussion_r119413232
--- Diff:
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpout.java
---
@@ -127,12 +132,19 @@ public void open(Map conf, TopologyContext context,
SpoutOutputCollector collect
// =========== Consumer Rebalance Listener - On the same thread as the
caller ===========
private class KafkaSpoutConsumerRebalanceListener implements
ConsumerRebalanceListener {
+ private ConsumerRebalanceHandlerTask task;
+
+ public
KafkaSpoutConsumerRebalanceListener(ConsumerRebalanceHandlerTask task) {
+ this.task = task;
+ }
+
@Override
public void onPartitionsRevoked(Collection<TopicPartition>
partitions) {
LOG.info("Partitions revoked. [consumer-group={}, consumer={},
topic-partitions={}]",
kafkaSpoutConfig.getConsumerGroupId(), kafkaConsumer,
partitions);
- if (!consumerAutoCommitMode && initialized) {
- initialized = false;
+
+ if (!consumerAutoCommitMode && task.isComplete()) {
--- End diff --
it's like an boolean, asynchronous task. start and stop will set the
boolean field. start() -> complete=true, stop() -> complete=false
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---