jtuglu1 commented on code in PR #19040:
URL: https://github.com/apache/druid/pull/19040#discussion_r2875707861


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -276,6 +277,25 @@ Set<String> taskIds()
       return tasks.keySet();
     }
 
+    /**
+     * Removes a task from {@link #tasks} and {@link #taskIdToServerPriority}.
+     */
+    void removeTask(String taskId)
+    {
+      tasks.remove(taskId);
+      taskIdToServerPriority.remove(taskId);
+    }
+
+    /**
+     * Removes a task from {@link #tasks} using the provided iterator and also 
removes the corresponding entry
+     * in {@link #taskIdToServerPriority}. Useful when removing tasks during 
iteration.
+     */
+    void removeTask(Iterator<Entry<String, TaskData>> taskDataIterator, String 
taskId)
+    {
+      taskDataIterator.remove();

Review Comment:
   Do we not need to remove taskId from `tasks`? If not, can we document why 
not?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to