isandeep41 commented on a change in pull request #12111:
URL: https://github.com/apache/druid/pull/12111#discussion_r778234566



##########
File path: server/src/main/java/org/apache/druid/server/QueryScheduler.java
##########
@@ -86,7 +91,34 @@
    * but it is OK in most cases since they will be cleaned up once the query 
is done.
    */
   private final SetMultimap<String, String> queryDatasources;
+  private final ServiceEmitter emitter;
 
+  public QueryScheduler(
+      int totalNumThreads,
+      QueryPrioritizationStrategy prioritizationStrategy,
+      QueryLaningStrategy laningStrategy,
+      ServerConfig serverConfig,
+      ServiceEmitter emitter
+  )
+  {
+    this.prioritizationStrategy = prioritizationStrategy;
+    this.laningStrategy = laningStrategy;
+    this.queryFutures = 
Multimaps.synchronizedSetMultimap(HashMultimap.create());
+    this.queryDatasources = 
Multimaps.synchronizedSetMultimap(HashMultimap.create());
+    // if totalNumThreads is above 0 and less than 
druid.server.http.numThreads, enforce total limit
+    final boolean limitTotal;
+    if (totalNumThreads > 0 && totalNumThreads < serverConfig.getNumThreads()) 
{
+      limitTotal = true;
+      this.totalCapacity = totalNumThreads;
+    } else {
+      limitTotal = false;
+      this.totalCapacity = serverConfig.getNumThreads();
+    }
+    this.laneRegistry = BulkheadRegistry.of(getLaneConfigs(limitTotal));
+    this.emitter = emitter;
+  }
+
+  @VisibleForTesting

Review comment:
       the ctor has been removed




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