Github user srdo commented on a diff in the pull request:
https://github.com/apache/storm/pull/2282#discussion_r133971254
--- Diff:
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaTupleListener.java
---
@@ -0,0 +1,48 @@
+package org.apache.storm.kafka.spout;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * The KafkaTupleListener handles state changes of a kafka tuple inside a
KafkaSpout.
+ */
+public interface KafkaTupleListener extends Serializable {
+
+ /**
+ * Called when the tuple is emitted.
+ *
+ * @param tuple the storm tuple.
+ * @param msgId The id of the tuple in the spout.
+ */
+ void onEmit(List<Object> tuple, KafkaSpoutMessageId msgId);
+
+
+ /**
+ * Called when a tuple is acked.
+ *
+ * @param msgId The id of the tuple in the spout.
+ */
+ void onAck(KafkaSpoutMessageId msgId);
+
+ /**
+ * Called when a fail reaches the spout, but the Kafka record does not
belong to the spout anymore.
--- End diff --
Nit: The kafka record belongs to a partition that is not assigned to the
spout anymore.
I'm wondering what this hook would be useful for? The record will get
replayed by a different task if using at-least-once, otherwise it'll be
dropped. I think if the reason it is here is to allow implementations to clean
up after emit, we should just have a general
onPartitionsReassigned(assignedPartitions) instead.
---
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.
---