public void incorporateCounters(JhCounters counters) { Map<String, Long> countersMap = JobHistoryUtils.extractCounters(counters); putCounters(countersMap); super.incorporateCounters(counters); }
/** incorporate event counters */ public void incorporateCounters(JhCounters counters) { Map<String, Long> countersMap = JobHistoryUtils.extractCounters(counters); putCounters(countersMap); super.incorporateCounters(counters); }
private static void incorporateCounter(SetField thunk, JhCounters counters, String counterName) { counterName = canonicalizeCounterName(counterName); for (JhCounterGroup group : counters.groups) { for (JhCounter counter : group.counts) { if (counterName .equals(canonicalizeCounterName(counter.name.toString()))) { thunk.set(counter.value); return; } } } }
public void incorporateCounters(JhCounters counters) { switch (taskType) { case MAP: incorporateMapCounters(counters); return; case REDUCE: incorporateReduceCounters(counters); return; // NOT exhaustive } }
/** * Extract/Add counters into the Map from the given JhCounters object. * @param counters the counters to be extracted from * @return the map of counters */ static Map<String, Long> extractCounters(JhCounters counters) { Map<String, Long> countersMap = new HashMap<String, Long>(); if (counters != null) { for (JhCounterGroup group : counters.groups) { for (JhCounter counter : group.counts) { countersMap.put(counter.name.toString(), counter.value); } } } return countersMap; }