@Override
  public void execute(DriverTask task) throws InterruptedException {
    long startNanos = ticker.read();
    // Try to switch it to RUNNING
    if (!scheduler.readyToRunning(task)) {
      return;
    }
    IDriver driver = task.getDriver();
    Duration timeSlice = getExecutionTimeSliceForDriverTask(task);
    ListenableFuture<?> future = driver.processFor(timeSlice);
    // If the future is cancelled, the task is in an error and should be thrown.
    if (future.isCancelled()) {
      task.setAbortCause(
          new DriverTaskAbortedException(
              task.getDriverTaskId().getFullId(),
              DriverTaskAbortedException.BY_ALREADY_BEING_CANCELLED));
      scheduler.toAborted(task);
      return;
    }
    long quantaScheduledNanos = ticker.read() - startNanos;
    ExecutionContext context = new ExecutionContext();
    context.setScheduledTimeInNanos(quantaScheduledNanos);
    context.setTimeSlice(timeSlice);
    if (driver.isFinished()) {
      scheduler.runningToFinished(task, context);
      return;
    }

    if (future.isDone()) {
      scheduler.runningToReady(task, context);
    } else {
      scheduler.runningToBlocked(task, context);
      future.addListener(
          () -> {
            try (SetThreadName driverTaskName2 =
                new SetThreadName(task.getDriver().getDriverTaskId().getFullId())) {
              scheduler.blockedToReady(task);
            }
          },
          listeningExecutor);
    }
  }
In multi-level feedback queue, levels with lower priority have longer time slices. Currently,
we assign (level + 1) * TimeSliceUnit to each level.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/schedule/DriverTaskThread.java