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
276277278279280281282283284285286
state = WritableUtils.readEnum(in, State.class); progress = in.readFloat(); diagnostics = WritableUtils.readString(in); userStatusInfo = WritableUtils.readString(in); phase = WritableUtils.readEnum(in, Phase.class); counters = new TezCounters(); counters.readFields(in); localOutputSize = in.readLong(); startTime = in.readLong();
416417418419420421422423424425426427
|| 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(); }
986987988989990991992993994995996
} } @Private public void constructFinalFullcounters() { this.fullCounters = new TezCounters(); this.fullCounters.incrAllCounters(dagCounters); for (Vertex v : this.vertices.values()) { this.fullCounters.incrAllCounters(v.getAllCounters()); } }
389390391392393394395396397398399400401
plr.getSize(), plr.getTimeStamp(), plr.hasPattern() ? plr.getPattern() : null); } public static TezCounters convertTezCountersFromProto(TezCountersProto proto) { TezCounters counters = new TezCounters(); for (TezCounterGroupProto counterGroupProto : proto.getCounterGroupsList()) { CounterGroup group = counters.addGroup(counterGroupProto.getName(), counterGroupProto.getDisplayName()); for (TezCounterProto counterProto : counterGroupProto.getCountersList()) { TezCounter counter = group.findCounter( counterProto.getName(),
101102103104105106107108109110111
String destinationVertexName = "destinationVertex"; TezDAGID dagID = new TezDAGID("2000", 1, 1); TezVertexID vertexID = new TezVertexID(dagID, 1); TezTaskID taskID = new TezTaskID(vertexID, 1); TezTaskAttemptID taskAttemptID = new TezTaskAttemptID(taskID, 1); TezCounters counters = new TezCounters(); byte[] userPayload = TezUtils.createUserPayloadFromConf(conf); RuntimeTask runtimeTask = null; int shufflePort = 2112; Map<String, String> auxEnv = new HashMap<String, String>();
414415416417418419420421422423424
} } @Override public TezCounters getCounters() { TezCounters counters = null; readLock.lock(); try { TaskAttempt bestAttempt = selectBestAttempt(); if (bestAttempt != null) { counters = bestAttempt.getCounters();
647648649650651652653654655656657
|| state == VertexState.KILLED || state == VertexState.SUCCEEDED) { this.mayBeConstructFinalFullCounters(); return fullCounters; } TezCounters counters = new TezCounters(); return incrTaskCounters(counters, tasks.values()); } finally { readLock.unlock(); }
15981599160016011602160316041605160616071608
} } @Private public void constructFinalFullcounters() { this.fullCounters = new TezCounters(); for (Task t : this.tasks.values()) { TezCounters counters = t.getCounters(); this.fullCounters.incrAllCounters(counters); } }
45464748495051525354
protected RuntimeTask(TaskSpec taskSpec, Configuration tezConf, TezUmbilical tezUmbilical) { this.taskSpec = taskSpec; this.tezConf = tezConf; this.tezUmbilical = tezUmbilical; this.tezCounters = new TezCounters(); this.eventCounter = new AtomicInteger(0); this.progress = 0.0f; this.taskDone = new AtomicBoolean(false); }
138139140141142143144145146147148149150151152153154155156157
+ (vertexName.equals("ivertex1") ? "intermediate-reducer" : vertexName) + " Progress: " + formatter.format(vProgressFloat)); } if (displayVertexCounters) { TezCounters counters = vStatus.getVertexCounters(); if (counters != null) { System.out.println("Vertex Counters for " + vertexName + ": " + counters); } } } } if (displayDAGCounters) { TezCounters counters = dagStatus.getDAGCounters(); if (counters != null) { System.out.println("DAG Counters: " + counters); } } }