private void addToPreemptionQueue(TaskWrapper taskWrapper) {
    if (taskWrapper.isInPreemptionQueue()) {
      return;
    }
    synchronized (lock) {
      insertIntoPreemptionQueueOrFailUnlocked(taskWrapper);
      taskWrapper.setIsInPreemptableQueue(true);
      metrics.setExecutorNumPreemptableRequests(preemptionQueue.size());
    }
  }
Assumes the epic lock is already taken.
llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskExecutorService.java