@Override
  public Set<String> getExecutorsStatusForReporting() {
    // TODO Change this method to make the output easier to parse (parse programmatically)
    Set<String> result = new LinkedHashSet<>();
    Set<String> running = new LinkedHashSet<>();
    Set<String> waiting = new LinkedHashSet<>();
    StringBuilder value = new StringBuilder();

    final List<TaskWrapper> queueState = new ArrayList<>();
    // Note: we don't take the scheduling lock here, although the call to queue is still
    //       synchronized. Best-effort to display the queue in order.
    waitQueue.apply(new Function<TaskWrapper, Boolean>() {
      public Boolean apply(TaskWrapper input) {
        queueState.add(input);
        return true;
      }});

    HashSet<TaskWrapper> queueHs = new HashSet<>();
    for (TaskWrapper task : queueState) {
      describeTask(value, task.getRequestId(), task, true);
      waiting.add(value.toString());
      queueHs.add(task);
    }

    for (Map.Entry<String, TaskWrapper> e : knownTasks.entrySet()) {
      String attemptId = e.getKey();
      TaskWrapper task = e.getValue();
      if (queueHs.contains(task)) {
        // Even if the state has changed, don't log it twice.
        continue;
      }
      boolean isWaiting = describeTask(value, attemptId, task, false);
      if (isWaiting) {
        waiting.add(value.toString());
      } else {
        running.add(value.toString());
      }
    }
    result.addAll(waiting);
    result.addAll(running);
    return result;
  }
Sets the TaskExecutorService capacity to the new values. Both the number of executors and the
queue size should be smaller than that original values, so we do not mess up with the other
settings. (For example: We do not allow higher executor number which could cause memory
oversubscription since the container memory sizes are calculated based on the maximum memory
and the maximum number of executors)
Setting smaller capacity will not cancel or reject already executing or queued tasks in itself.
@param newNumExecutors The new number of executors
@param newWaitQueueSize The new number of wait queue size
llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskExecutorService.java