cadonna commented on a change in pull request #11499:
URL: https://github.com/apache/kafka/pull/11499#discussion_r749480160



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/StateUpdater.java
##########
@@ -0,0 +1,50 @@
+package org.apache.kafka.streams.processor.internals;
+
+import java.time.Duration;
+import java.util.List;
+
+public interface StateUpdater {
+
+    /**
+     * Adds a task (active or standby) to the state updater.
+     *
+     * The state of the task will be updated.
+     *
+     * @param task task
+     */
+    void add(final Task task);
+
+    /**
+     * Removes a task (active and standby) from the state updater.
+     *
+     * A task is removed from the state updater irrespective of whether its 
state is up-to-date or not.
+     *
+     * @param task tasks to remove
+     */
+    void remove(final Task task);
+
+    /**
+     * Gets restored active tasks from state restoration/update
+     *
+     * @param timeout duration how long the calling thread should wait for 
restored active tasks
+     *
+     * @return list of active tasks with up-to-date states
+     */
+    List<StreamTask> getRestoredActiveTasks(final Duration timeout);
+
+    /**
+     * Gets a list of tasks that failed during restoration.
+     *
+     * The exception that caused the failure can be retrieved by {@link 
Task#getException()}
+     *
+     * @return failed tasks
+     */
+    List<Task> getFailedTasks();

Review comment:
       If a task fails during restoration it is returned by this method. The 
exception that caused the failure can be retrieved from the task itself with 
`Task#getException()`.




-- 
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-unsubscr...@kafka.apache.org

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


Reply via email to