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


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/HeapMemoryTaskStorage.java:
##########
@@ -159,6 +160,18 @@ public List<Task> getActiveTasks()
     return listBuilder.build();
   }
 
+  @Override
+  public List<TaskInfo<Task, TaskStatus>> getActiveTaskInfos()
+  {
+    final ImmutableList.Builder<TaskInfo<Task, TaskStatus>> listBuilder = 
ImmutableList.builder();
+    for (final TaskStuff taskStuff : tasks.values()) {
+      if (taskStuff.getStatus().isRunnable()) {
+        listBuilder.add(TaskStuff.toTaskInfo(taskStuff));
+      }
+    }

Review Comment:
   Feel free to ignore the following suggestion. I suppose the following looks 
more readable:
   
   ```
   @Override
   public List<TaskInfo<Task, TaskStatus>> getActiveTaskInfos() {
     return tasks.values().stream()
         .filter(taskStuff -> taskStuff.getStatus().isRunnable())
         .map(TaskStuff::toTaskInfo)
         .collect(ImmutableList.toImmutableList());
   }
   ```



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