You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "cadonna (via GitHub)" <gi...@apache.org> on 2023/02/14 10:57:41 UTC

[GitHub] [kafka] cadonna commented on a diff in pull request #13025: KAFKA-14299: Fix pause and resume with state updater

cadonna commented on code in PR #13025:
URL: https://github.com/apache/kafka/pull/13025#discussion_r1105612105


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/ReadOnlyTask.java:
##########
@@ -190,7 +190,7 @@ public void clearTaskTimeout() {
 
     @Override
     public boolean commitNeeded() {
-        throw new UnsupportedOperationException("This task is read-only");
+        return task.commitNeeded();

Review Comment:
   It gives me a bit of a headache to forward the call to `commitNeeded()` since it changes the state of a stream task by updating the consumed offsets.
   I am also wondering why Streams also commits restoring tasks.    



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/ReadOnlyTask.java:
##########
@@ -200,7 +200,7 @@ public StateStore getStore(final String name) {
 
     @Override
     public Map<TopicPartition, Long> changelogOffsets() {
-        throw new UnsupportedOperationException("This task is read-only");
+        return task.changelogOffsets();

Review Comment:
   If I understand the code correctly, this forwarding is fine.



-- 
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.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org