gianm commented on code in PR #19559:
URL: https://github.com/apache/druid/pull/19559#discussion_r3359271863


##########
multi-stage-query/src/main/java/org/apache/druid/msq/dart/guice/DartWorkerConfig.java:
##########
@@ -41,6 +44,22 @@ public class DartWorkerConfig
   @JsonProperty("heapFraction")
   private double heapFraction = DEFAULT_HEAP_FRACTION;
 
+  /**
+   * Worker-local value for the segment load-ahead count used to size segment 
prefetch in {@link ReadableInputQueue}.
+   * <p>
+   * Defaults to null (unset), which leaves the value to query context (client 
or controller-default supplied) and the
+   * built-in {@code 2 * threadCount} fallback. When set to a positive value, 
it acts as a worker-local floor: the
+   * effective count becomes the larger of this value and any value present in 
the query context, so a query can still

Review Comment:
   I think it would be better to use the value from the query context as-is, if 
it is provided. That way the query context can more easily be used for 
experimentation and temporary tuning, in either direction.



##########
multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/DartWorkerContext.java:
##########
@@ -148,6 +157,9 @@ public class DartWorkerContext implements WorkerContext
     final int baseThreadCount = processingConfig.getNumThreads();
     final Integer maxThreads = 
MultiStageQueryContext.getMaxThreads(queryContext);
     this.threadCount = (maxThreads != null && maxThreads > 0) ? 
Math.min(baseThreadCount, maxThreads) : baseThreadCount;
+
+    // Worker-local segment load-ahead config, read once from this worker's 
DartWorkerConfig.
+    this.segmentLoadAheadCountConfig = 
injector.getInstance(DartWorkerConfig.class).getSegmentLoadAheadCount();

Review Comment:
   Probably better to not use the injector so explicitly here. It would be more 
aligned to do it like the other stuff in this constructor, which is injected 
into `DartWorkerContextFactoryImpl` and then passed through.



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