Interface QueryProcessingPool

All Superinterfaces:
Executor, ExecutorService, com.google.common.util.concurrent.ListeningExecutorService
All Known Implementing Classes:
DirectQueryProcessingPool, ForwardingQueryProcessingPool, MetricsEmittingQueryProcessingPool, NoopQueryProcessingPool

public interface QueryProcessingPool extends com.google.common.util.concurrent.ListeningExecutorService
This class implements the logic of how units of query execution run concurrently. It is used in QueryRunnerFactory.mergeRunners(QueryProcessingPool, Iterable). In a most straightforward implementation, each unit will be submitted to an PrioritizedExecutorService. Extensions, however, can implement their own logic for picking which unit to pick first for execution.

This interface extends ListeningExecutorService as well. It has a separate method to submit query execution tasks so that implementations can differentiate those tasks from any regular async tasks. One example is GroupingEngine.mergeRunners(QueryProcessingPool, Iterable) where different kind of tasks are submitted to same processing pool.

Query execution task also includes a reference to QueryRunner so that any state required to decide the priority of a unit can be carried forward with the corresponding QueryRunner.

  • Method Details

    • submitRunnerTask

      <T, V> com.google.common.util.concurrent.ListenableFuture<T> submitRunnerTask(PrioritizedQueryRunnerCallable<T,V> task)
      Submits the query execution unit task for asynchronous execution.
      Type Parameters:
      T - - Task result type
      V - - Query runner sequence type
      Parameters:
      task - - Task to be submitted.
      Returns:
      - Future object for tracking the task completion.
    • submitRunnerTask

      <T, V> com.google.common.util.concurrent.ListenableFuture<T> submitRunnerTask(PrioritizedQueryRunnerCallable<T,V> task, long timeout, TimeUnit unit)
      Submits the query execution task for asynchronous execution, with a provided timeout.
      Type Parameters:
      T - - Task result type
      V - - Query runner sequence type
      Parameters:
      task - - Task to be submitted.
      timeout - - Timeout value
      unit - - Timeout unit
      Returns:
      - Future object for tracking the task completion.