Counters holds per job/task counters, defined either by the framework or applications. Each Counter can be of any {@link Enum} type.
Counters
Counter
Counters are bunched into {@link CounterGroup}s, each comprising of counters from a particular Enum class.
Enum
716717718719720721722723724725726
|| state == VertexState.KILLED || state == VertexState.SUCCEEDED) { this.mayBeConstructFinalFullCounters(); return fullCounters; } TezCounters counters = new TezCounters(); return incrTaskCounters(counters, tasks.values()); } finally { readLock.unlock(); }
25322533253425352536253725382539254025412542254325442545
} } @Private public void constructFinalFullcounters() { this.fullCounters = new TezCounters(); this.vertexStats = new VertexStats(); for (Task t : this.tasks.values()) { vertexStats.updateStats(t.getReport()); TezCounters counters = t.getCounters(); this.fullCounters.incrAllCounters(counters); } }
422423424425426427428429430431432
} } @Override public TezCounters getCounters() { TezCounters counters = null; readLock.lock(); try { TaskAttempt bestAttempt = selectBestAttempt(); if (bestAttempt != null) { counters = bestAttempt.getCounters();
578579580581582583584585586587588
@Override public TezCounters getCounters() { readLock.lock(); try { reportedStatus.setLocalityCounter(this.localityCounter); TezCounters counters = reportedStatus.counters; if (counters == null) { counters = EMPTY_COUNTERS; } return counters; } finally {
423424425426427428429430431432433
742743744745746747748749750751752
26822683268426852686268726882689269026912692269326942695
543544545546547548549550551552553554
|| state == DAGState.KILLED || state == DAGState.SUCCEEDED) { this.mayBeConstructFinalFullCounters(); return fullCounters; } TezCounters counters = new TezCounters(); counters.incrAllCounters(dagCounters); return incrTaskCounters(counters, vertices.values()); } finally { readLock.unlock(); }
15101511151215131514151515161517151815191520
} } @Private public void constructFinalFullcounters() { this.fullCounters = new TezCounters(); this.fullCounters.incrAllCounters(dagCounters); for (Vertex v : this.vertices.values()) { this.fullCounters.incrAllCounters(v.getAllCounters()); } }
4950515253545556575859
private AtomicBoolean localitySet = new AtomicBoolean(false); public void setLocalityCounter(DAGCounter localityCounter) { if (!localitySet.get()) { localitySet.set(true); if (counters == null) { counters = new TezCounters(); } if (localityCounter != null) { counters.findCounter(localityCounter).increment(1); // TODO Maybe validate that the correct value is being set. }