kfaraz commented on code in PR #14546:
URL: https://github.com/apache/druid/pull/14546#discussion_r1257314336
##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/ImmutableWorkerInfo.java:
##########
@@ -90,6 +94,48 @@ public ImmutableWorkerInfo(
this(worker, currCapacityUsed, 0, availabilityGroups, runningTasks,
lastCompletedTaskTime, null);
}
+ public static ImmutableWorkerInfo fromWorkerAnnouncements(
+ final Worker worker,
+ final Map<String, TaskAnnouncement> announcements,
+ final DateTime lastCompletedTaskTime,
+ @Nullable final DateTime blacklistedUntil
+ )
+ {
+ int currCapacityUsed = 0;
+ int currParallelIndexCapacityUsed = 0;
+ ImmutableSet.Builder<String> taskIds = ImmutableSet.builder();
+ ImmutableSet.Builder<String> availabilityGroups = ImmutableSet.builder();
+
+ for (final Map.Entry<String, TaskAnnouncement> entry :
announcements.entrySet()) {
+ final TaskAnnouncement announcement = entry.getValue();
+
+ if (announcement.getStatus().isRunnable()) {
Review Comment:
Yeah, filtering here makes sense.
--
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]