klsince commented on code in PR #9171:
URL: https://github.com/apache/pinot/pull/9171#discussion_r947271960


##########
pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java:
##########
@@ -105,6 +117,73 @@ public QueryScheduler(PinotConfiguration config, 
QueryExecutor queryExecutor, Re
    */
   public abstract ListenableFuture<byte[]> submit(ServerQueryRequest 
queryRequest);
 
+  /**
+   * Submit a query for execution and track runtime context about the query 
for things like cancellation.
+   * @param queryRequest query to schedule for execution
+   * @return Listenable future for query result representing serialized 
response. Custom callbacks can be added on
+   * the future to clean up the runtime context tracked during query execution.
+   */
+  public ListenableFuture<byte[]> submitQuery(ServerQueryRequest queryRequest) 
{
+    ListenableFuture<byte[]> future = submit(queryRequest);
+    if (_enableQueryCancellation) {
+      String queryId = queryRequest.getQueryId();
+      // Track the running query for cancellation.
+      if (LOGGER.isDebugEnabled()) {

Review Comment:
   I don't think it adds much overhead as JIT might just remove the whole 
if-block. I was mainly to keep convention consistent as I see broker side 
already calls many debug() w/o this flag check.



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to