guozhangwang commented on code in PR #12737:
URL: https://github.com/apache/kafka/pull/12737#discussion_r993979720


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/tasks/TaskManager.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams.processor.internals.tasks;
+
+import org.apache.kafka.common.KafkaFuture;
+import org.apache.kafka.streams.processor.TaskId;
+import org.apache.kafka.streams.processor.internals.ReadOnlyTask;
+import org.apache.kafka.streams.processor.internals.StreamTask;
+import java.util.Set;
+
+public interface TaskManager {
+
+    /**
+     * Get the next processible active task for the requested executor. Once 
the task is assigned to
+     * the requested task executor, it should not be assigned to any other 
executors until it was
+     * returned to the task manager.
+     *
+     * @param executor the requesting {@link TaskExecutor}
+     */
+    StreamTask assignNextTask(final TaskExecutor executor);

Review Comment:
   The tasks set manipulations i.e. adding/removing, and also committing is 
done by the polling thread. The task processing itself, including grabbing the 
task from the task manager is done by the processing thread.
   
   Good question about when all tasks are locked. In this case we would not 
fail but just return null -- I will clarify that in the doc.



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