jihoonson commented on a change in pull request #6629: Add support parallel 
combine in brokers
URL: https://github.com/apache/incubator-druid/pull/6629#discussion_r241899804
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/query/QueryContexts.java
 ##########
 @@ -174,6 +179,35 @@
     }
   }
 
+  private static int checkPositive(String propertyName, int val)
+  {
+    Preconditions.checkArgument(
+        val > 0,
+        "%s should be positive, but [%s]",
+        propertyName,
+        val
+    );
+    return val;
+  }
+
+  /**
+   * Return the configured number of combine threads if any. Others {@link 
#NO_PARALLEL_COMBINE_THREADS}.
+   */
+  public static <T> int getNumBrokerParallelCombineThreads(Query<T> query)
+  {
+    return parseInt(query, NUM_BROKER_PARALLEL_COMBINE_THREADS, 
NO_PARALLEL_COMBINE_THREADS);
 
 Review comment:
   @leventov I'm still not sure what your idea is to achieve. Currently, a 
broker can combine multiple queries at the same time without blocking each 
other, although the number of concurrent queries is limited by the number of 
its http threads. I'm not sure how your idea is better than now.
   
   Do you just want to avoid the manual setting for 
`NUM_BROKER_PARALLEL_COMBINE_THREADS`? My intention was we need a way to 
explicitly specify the number of threads for combine because automatic 
optimization might be wrong or not enough. (This is especially true in this PR 
because the only available option for auto optimization is to set 
`NUM_BROKER_PARALLEL_COMBINE_THREADS` to -1.) However, if they really want to 
use some particular number of threads, there should be enough available threads 
at the query time. Otherwise, the query will be blocked and failed in the end.
   
   What do you think about this? And do you think it makes sense to add a 
better optimization mechanism later?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to