server/src/main/java/org/apache/druid/server/QueryScheduler.java
/**
   * Assign a query a priority and lane (if not set)
   */
Assign a query a priority and lane (if not set)
Assign a query a priority and lane ( if not set )
public <T> Query<T> prioritizeAndLaneQuery(QueryPlus<T> queryPlus, Set<SegmentServerSelector> segments)
  {
    Query<T> query = queryPlus.getQuery();
    Optional<Integer> priority = prioritizationStrategy.computePriority(queryPlus, segments);
    query = priority.map(query::withPriority).orElse(query);
    Optional<String> lane = laningStrategy.computeLane(queryPlus.withQuery(query), segments);
    LOGGER.debug(
        "[%s] lane assigned to [%s] query with [%,d] priority",
        lane.orElse("default"),
        query.getType(),
        priority.orElse(0)
    );
    final ServiceMetricEvent.Builder builderUsr = ServiceMetricEvent.builder().setFeed("metrics")
                                                                    .setDimension("lane", lane.orElse("default"))
                                                                    .setDimension("dataSource", query.getDataSource().getTableNames())
                                                                    .setDimension("type", query.getType());
    emitter.emit(builderUsr.build("query/priority", priority.orElse(Integer.valueOf(0))));
    return lane.map(query::withLane).orElse(query);
  }
public < T > Query < T > prioritizeAndLaneQuery ( QueryPlus < T > queryPlus , Set < SegmentServerSelector > segments ) { Query < T > query = queryPlus . getQuery ( ) ; Optional < Integer > priority = prioritizationStrategy . computePriority ( queryPlus , segments ) ; query = priority . map ( query :: withPriority ) . orElse ( query ) ; Optional < String > lane = laningStrategy . computeLane ( queryPlus . withQuery ( query ) , segments ) ; LOGGER . debug ( "[%s] lane assigned to [%s] query with [%,d] priority" , lane . orElse ( "default" ) , query . getType ( ) , priority . orElse ( 0 ) ) ; final ServiceMetricEvent . Builder builderUsr = ServiceMetricEvent . builder ( ) . setFeed ( "metrics" ) . setDimension ( "lane" , lane . orElse ( "default" ) ) . setDimension ( "dataSource" , query . getDataSource ( ) . getTableNames ( ) ) . setDimension ( "type" , query . getType ( ) ) ; emitter . emit ( builderUsr . build ( "query/priority" , priority . orElse ( Integer . valueOf ( 0 ) ) ) ) ; return lane . map ( query :: withLane ) . orElse ( query ) ; }
Assign a query a priority and lane (if not set)
Assign a query a priority and lane ( if not set )