コード例 #1
0
  /** {@inheritDoc} */
  @Override
  public synchronized Iterable<String> getGroupNames() {
    Collection<String> res = new HashSet<>();

    for (HadoopCounter counter : cntrs.values()) res.add(counter.group());

    return res;
  }
コード例 #2
0
  /**
   * Returns counters iterator for specified group.
   *
   * @param grpName Name of the group to iterate.
   * @return Counters iterator.
   */
  public Iterator<Counter> iterateGroup(String grpName) {
    Collection<Counter> grpCounters = new ArrayList<>();

    for (HadoopLongCounter counter : cntrs.values()) {
      if (grpName.equals(counter.group())) grpCounters.add(new HadoopV2Counter(counter));
    }

    return grpCounters.iterator();
  }