public void registerTaskAllocated(String[] requestedHosts, String[] requestedRacks, String allocatedHost) {
    // TODO Change after HIVE-9987. For now, there's no rack matching.
    if (requestedHosts != null && requestedHosts.length != 0) {
      Set<String> requestedHostSet = new HashSet<>(Arrays.asList(requestedHosts));
      if (requestedHostSet.contains(allocatedHost)) {
        numLocalAllocations++;
        _registerAllocationInHostMap(allocatedHost, localityBasedNumAllocationsPerHost);
      } else {
        numNonLocalAllocations++;
      }
    } else {
      numAllocationsNoLocalityRequest++;
    }
    numTotalAllocations++;
    _registerAllocationInHostMap(allocatedHost, numAllocationsPerHost);
  }
Update DAG metrics caused by an incoming allocate Task call.
Updated metrics should use Atomics here to avoid using a lock on the caller.
@param requestedHosts
@param requestedRacks
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/scheduler/StatsPerDag.java