@Override
  public void allocateTask(Object task, Resource capability, ContainerId containerId,
      Priority priority, Object containerSignature, Object clientCookie) {
    // Container affinity can be implemented as Host affinity for LLAP. Not required until
    // 1:1 edges are used in Hive.
    TezTaskAttemptID id = getTaskAttemptId(task);
    TaskInfo taskInfo = new TaskInfo(localityDelayConf, clock, task, clientCookie, priority,
        capability, null, null, clock.getTime(), id);
    LOG.info("Received allocateRequest. task={}, priority={}, capability={}, containerId={}",
        task, priority, capability, containerId);
    if (!dagRunning) {
      if (metrics != null && id != null) {
        metrics.setDagId(id.getDAGID().toString());
      }
      dagRunning = true;
    }
    dagStats.registerTaskRequest(null, null);
    addPendingTask(taskInfo);
    trySchedulingPendingTasks();
  }
The difference between this and getTotalResources() is that this only gives currently free
resource instances, while the other lists all the instances that may become available in a
while.
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java