findingrish commented on code in PR #14845:
URL: https://github.com/apache/druid/pull/14845#discussion_r1300976888


##########
server/src/main/java/org/apache/druid/server/coordinator/loading/LoadQueueTaskMaster.java:
##########
@@ -81,6 +91,50 @@ public LoadQueuePeon giveMePeon(ImmutableDruidServer server)
     }
   }
 
+  public Map<String, LoadQueuePeon> getAllPeons()
+  {
+    return loadManagementPeons;
+  }
+
+  public LoadQueuePeon getPeonForServer(ImmutableDruidServer server)
+  {
+    return loadManagementPeons.get(server.getName());
+  }
+
+  public void startPeonsForNewServers(List<ImmutableDruidServer> 
currentServers)
+  {
+    for (ImmutableDruidServer server : currentServers) {
+      loadManagementPeons.computeIfAbsent(server.getName(), serverName -> {
+        LoadQueuePeon loadQueuePeon = createPeon(server);
+        loadQueuePeon.start();
+        log.debug("Created LoadQueuePeon for server[%s].", server.getName());
+        return loadQueuePeon;
+      });
+    }
+  }
+
+  public void stopPeonsForDisappearedServers(List<ImmutableDruidServer> 
servers)
+  {
+    final Set<String> disappearedServers = 
Sets.newHashSet(loadManagementPeons.keySet());

Review Comment:
   From the method name I assumed that we would stopping peons for the sets of 
servers passed, instead it seems to be doing the opposite. Can you please add a 
comment? 



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