public final boolean isLocalityInfoAvailable() {
    Map<String, TezCounter> dataLocalTask =
        getCounter(DAGCounter.class.getName(), DAGCounter.DATA_LOCAL_TASKS.toString());
    Map<String, TezCounter> rackLocalTask =
        getCounter(DAGCounter.class.getName(), DAGCounter.RACK_LOCAL_TASKS.toString());

    Map<String, TezCounter> otherLocalTask =
        getCounter(DAGCounter.class.getName(), DAGCounter.OTHER_LOCAL_TASKS.toString());

    if (!dataLocalTask.isEmpty() || !rackLocalTask.isEmpty() || !otherLocalTask.isEmpty()) {
      return true;
    }
    return false;
  }
  public final TezCounter getLocalityInfo() {
    Map<String, TezCounter> dataLocalTask =
        getCounter(DAGCounter.class.getName(), DAGCounter.DATA_LOCAL_TASKS.toString());
    Map<String, TezCounter> rackLocalTask =
        getCounter(DAGCounter.class.getName(), DAGCounter.RACK_LOCAL_TASKS.toString());
    Map<String, TezCounter> otherLocalTask =
        getCounter(DAGCounter.class.getName(), DAGCounter.OTHER_LOCAL_TASKS.toString());

    if (!dataLocalTask.isEmpty()) {
      return dataLocalTask.get(DAGCounter.class.getName());
    }

    if (!rackLocalTask.isEmpty()) {
      return rackLocalTask.get(DAGCounter.class.getName());
    }

    if (!otherLocalTask.isEmpty()) {
      return otherLocalTask.get(DAGCounter.class.getName());
    }
    return null;
  }