You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/05/27 18:08:57 UTC

[GitHub] [druid] zachjsh commented on a change in pull request #11302: Add integer parsing in HiLoQueryLaningStrategy

zachjsh commented on a change in pull request #11302:
URL: https://github.com/apache/druid/pull/11302#discussion_r640858229



##########
File path: server/src/main/java/org/apache/druid/server/scheduling/HiLoQueryLaningStrategy.java
##########
@@ -67,8 +67,12 @@ public HiLoQueryLaningStrategy(
   public <T> Optional<String> computeLane(QueryPlus<T> query, Set<SegmentServerSelector> segments)
   {
     final Query<T> theQuery = query.getQuery();
-    // QueryContexts.getPriority gives a default, since we are setting priority
-    final Integer priority = theQuery.getContextValue(QueryContexts.PRIORITY_KEY);
+    // QueryContexts.getPriority gives a default, but it can parse the value to integer. Before calling QueryContexts.getPriority
+    // we make sure that priority has been set.
+    Integer priority = null;
+    if (null != theQuery.getContextValue(QueryContexts.PRIORITY_KEY)) {

Review comment:
       nit: Can be simplified to ternary




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org