public final class EmptyKafkaTupleListener extends Object implements KafkaTupleListener
Constructor and Description |
---|
EmptyKafkaTupleListener() |
Modifier and Type | Method and Description |
---|---|
void |
onAck(KafkaSpoutMessageId msgId)
Called when a tuple is acked.
|
void |
onEmit(List<Object> tuple,
KafkaSpoutMessageId msgId)
Called when the tuple is emitted and auto commit is disabled.
|
void |
onMaxRetryReached(KafkaSpoutMessageId msgId)
Called when the maximum number of retries have been reached.
|
void |
onPartitionsReassigned(Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
Called when kafka partitions are rebalanced.
|
void |
onRetry(KafkaSpoutMessageId msgId)
Called when the Kafka spout sets a record for retry.
|
void |
open(Map<String,Object> conf,
TopologyContext context)
Called during the initialization of the kafka spout.
|
String |
toString() |
public void open(Map<String,Object> conf, TopologyContext context)
KafkaTupleListener
Called during the initialization of the kafka spout.
open
in interface KafkaTupleListener
conf
- The storm configuration.context
- The TopologyContext
public void onEmit(List<Object> tuple, KafkaSpoutMessageId msgId)
KafkaTupleListener
Called when the tuple is emitted and auto commit is disabled. If kafka auto commit is enabled, the kafka consumer will periodically (depending on the commit interval) commit the offsets. Therefore, storm disables anchoring for tuples when auto commit is enabled and the spout will not receive acks and fails for those tuples.
onEmit
in interface KafkaTupleListener
tuple
- the storm tuple.msgId
- The id of the tuple in the spout.public void onAck(KafkaSpoutMessageId msgId)
KafkaTupleListener
Called when a tuple is acked.
onAck
in interface KafkaTupleListener
msgId
- The id of the tuple in the spout.public void onPartitionsReassigned(Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
KafkaTupleListener
Called when kafka partitions are rebalanced.
onPartitionsReassigned
in interface KafkaTupleListener
topicPartitions
- The list of partitions that are now assigned to the consumer (may include partitions previously assigned to the consumer)public void onRetry(KafkaSpoutMessageId msgId)
KafkaTupleListener
Called when the Kafka spout sets a record for retry.
onRetry
in interface KafkaTupleListener
msgId
- The id of the tuple in the spout.public void onMaxRetryReached(KafkaSpoutMessageId msgId)
KafkaTupleListener
Called when the maximum number of retries have been reached.
onMaxRetryReached
in interface KafkaTupleListener
msgId
- The id of the tuple in the spout.Copyright © 2019 The Apache Software Foundation. All Rights Reserved.