mjsax commented on a change in pull request #8833:
URL: https://github.com/apache/kafka/pull/8833#discussion_r437796880
##########
File path:
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java
##########
@@ -378,42 +320,88 @@ public void prepareCommit() {
break;
case CREATED:
- case SUSPENDED:
case CLOSED:
throw new IllegalStateException("Illegal state " + state() + "
while preparing active task " + id + " for committing");
default:
throw new IllegalStateException("Unknown state " + state() + "
while preparing active task " + id + " for committing");
}
+
+ return committableOffsetsAndMetadata();
}
- @Override
- public void postCommit() {
+ private Map<TopicPartition, OffsetAndMetadata>
committableOffsetsAndMetadata() {
+ final Map<TopicPartition, OffsetAndMetadata> committableOffsets;
+
switch (state()) {
- case RUNNING:
- commitNeeded = false;
- commitRequested = false;
+ case CREATED:
+ case RESTORING:
+ committableOffsets = Collections.emptyMap();
- if (!eosEnabled) {
- stateMgr.checkpoint(checkpointableOffsets());
- }
+ break;
- log.debug("Committed");
+ case RUNNING:
+ case SUSPENDED:
+ final Map<TopicPartition, Long> partitionTimes =
extractPartitionTimes();
+
+ committableOffsets = new HashMap<>(consumedOffsets.size());
Review comment:
Well, what is the probability that it did not change? Feel free to file
a ticket if you think it's worth it, but I would like to not piggy-back other
things into the PR>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]