kfaraz commented on code in PR #17775:
URL: https://github.com/apache/druid/pull/17775#discussion_r1978757062


##########
server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java:
##########
@@ -112,23 +115,27 @@ public class HttpLoadQueuePeon implements LoadQueuePeon
 
   private final HttpLoadQueuePeonConfig config;
 
+  private final String serverName;
   private final ObjectMapper jsonMapper;
   private final HttpClient httpClient;
   private final URL changeRequestURL;
   private final String serverId;
 
   private final AtomicBoolean mainLoopInProgress = new AtomicBoolean(false);
   private final ExecutorService callBackExecutor;
+  private final CoordinatorConfigManager coordinatorConfigManager;
 
   private final ObjectWriter requestBodyWriter;
 
   public HttpLoadQueuePeon(
       String baseUrl,
+      String serverName,
       ObjectMapper jsonMapper,
       HttpClient httpClient,
       HttpLoadQueuePeonConfig config,
       ScheduledExecutorService processingExecutor,
-      ExecutorService callBackExecutor
+      ExecutorService callBackExecutor,
+      CoordinatorConfigManager coordinatorConfigManager

Review Comment:
   Sure, that would work too.
   Also, please make sure that you pass a `Supplier<CoordinatorDynamicConfig>` 
(instead of the `CoordinatorConfigManager`) in the constructor of 
`LoadQueueTaskMaster` too.
   
   
   ---
   
   FYI, you could still make do with `Supplier<SegmentLoadingMode>` since you 
are passing the server name here anyway.
   
   The `LoadQueueTaskMaster` code could look like this:
   
   ```
       final String serverName = server.getName();
       return new HttpLoadQueuePeon(
           server.getURL(),
           jsonMapper,
           httpClient,
           config,
           peonExec,
           callbackExec,
           () -> dynamicConfig.get().getLoadingMode(serverName)
       );
   ```
   
   I would prefer this approach since then the load queue peon need not be 
aware of the entire dynamic config.



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