Example #1
0
  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;
  }
Example #2
0
  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;
  }