Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,15 @@ private void commitOffsetsForAckedTuples() {
public void ack(Object messageId) {
final KafkaSpoutMessageId msgId = (KafkaSpoutMessageId) messageId;
if (!consumerAutoCommitMode) { // Only need to keep track of acked tuples if commits are not done automatically
acked.get(msgId.getTopicPartition()).add(msgId);
final MessageId msgId = (MessageId) messageId;
TopicPartition partition = msgId.getTopicPartition();
OffsetEntry entry = acked.get(partition);
if (entry == null) {
LOG.warn("Tried to add message with id {} to non-existing partition {}.", msgId, partition);
return;
}
entry.add(msgId);
LOG.debug("Added acked message [{}] to list of messages to be committed to Kafka", msgId);
}
emitted.remove(msgId);
}
Expand Down