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


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java:
##########
@@ -835,26 +844,24 @@ void syncFromStorage()
 
     try {
       if (active) {
-        final Map<String, Task> newTasks =
-            CollectionUtils.toMap(taskStorage.getActiveTasks(), Task::getId, 
Function.identity());
-        final Map<String, Task> oldTasks =
-            CollectionUtils.mapValues(activeTasks, entry -> entry.task);
+        final Map<String, TaskInfo<Task, TaskStatus>> newTasks = 
CollectionUtils.toMap(taskStorage.getActiveTaskInfos(), (taskInfo) -> 
taskInfo.getTask().getId(), Function.identity());
+        final Map<String, TaskInfo<Task, TaskStatus>> oldTasks = 
CollectionUtils.mapValues(activeTasks, entry -> entry.taskInfo);
 
         // Identify the tasks that have been added or removed from the storage
-        final MapDifference<String, Task> mapDifference = 
Maps.difference(oldTasks, newTasks);
-        final Collection<Task> addedTasks = 
mapDifference.entriesOnlyOnRight().values();
-        final Collection<Task> removedTasks = 
mapDifference.entriesOnlyOnLeft().values();
+        final MapDifference<String, TaskInfo<Task, TaskStatus>> mapDifference 
= Maps.difference(oldTasks, newTasks);
+        final Collection<TaskInfo<Task, TaskStatus>> addedTasks = 
mapDifference.entriesOnlyOnRight().values();
+        final Collection<TaskInfo<Task, TaskStatus>> removedTasks = 
mapDifference.entriesOnlyOnLeft().values();
 
         // Remove tasks not present in metadata store if their lastUpdatedTime 
is before syncStartTime
         int numTasksRemoved = 0;
-        for (Task task : removedTasks) {
+        for (TaskInfo<Task, TaskStatus> task : removedTasks) {

Review Comment:
   Agreed



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