@Override
    public Void call() {
      while (!isShutdown.get() && !Thread.currentThread().isInterrupted()) {
        try {
          TaskInfo taskInfo = highPriorityTaskQueue.take();
          // Tasks can exist in the queue even after they have been scheduled.
          // Process task Preemption only if the task is still in PENDING state.
          processTaskPreemption(taskInfo);

        } catch (InterruptedException e) {
          if (isShutdown.get()) {
            LOG.info("PreemptTaskScheduler thread interrupted after shutdown");
            break;
          } else {
            LOG.warn("PreemptTaskScheduler thread interrupted before being shutdown");
            throw new RuntimeException("PreemptTaskScheduler thread interrupted without being shutdown", e);
          }
        }
      }
      return null;
    }
Go through the running tasks Tree in descending priority and find a candidate to preempt. The candidate should be:
1. lower priority than forTask
2. below forTask in the DAG
3. not considered already for preemption
A successful candidate is added to the preemptionCandidates queue for preemption by the scheduling loop.
@param runningTasks Tree of running tasks
@param forTask Task to find preemption candidate for
@param preemptHosts Hosts preference
@return true when preemption candidate is found
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java