private void insertIntoPreemptionQueueOrFailUnlocked(TaskWrapper taskWrapper) {
    boolean added = preemptionQueue.offer(taskWrapper);
    if (!added) {
      LOG.warn("Failed to add element {} to preemption queue. Terminating", taskWrapper);
      Thread.getDefaultUncaughtExceptionHandler().uncaughtException(Thread.currentThread(),
          new IllegalStateException("Preemption queue full. Cannot proceed"));
    }
  }
Assumes the epic lock is already taken.
llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskExecutorService.java