abhishekrb19 commented on code in PR #19040:
URL: https://github.com/apache/druid/pull/19040#discussion_r2876125797
##########
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:
This is already an iterator from `tasks.keySet()`, so it does remove the
entry from `tasks`. I’ve updated the javadoc to clarify that and added a test
as well
--
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]