/** {@inheritDoc} */ @Override public synchronized Iterable<String> getGroupNames() { Collection<String> res = new HashSet<>(); for (HadoopCounter counter : cntrs.values()) res.add(counter.group()); return res; }
/** * Returns size of a group. * * @param grpName Name of the group. * @return amount of counters in the given group. */ public int groupSize(String grpName) { int res = 0; for (HadoopCounter counter : cntrs.values()) { if (grpName.equals(counter.group())) res++; } return res; }
/** * Creates new instance based on given counters. * * @param cntrs Counters to adapt. */ public HadoopMapReduceCounters( org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters cntrs) { for (HadoopCounter cntr : cntrs.all()) if (cntr instanceof HadoopLongCounter) this.cntrs.put(new T2<>(cntr.group(), cntr.name()), (HadoopLongCounter) cntr); }