.getGroup(MRPigStatsUtil.MULTI_INPUTS_COUNTER_GROUP); if (multiInputGroup == null) { processorContext.getCounters().addGroup( MRPigStatsUtil.MULTI_INPUTS_COUNTER_GROUP, MRPigStatsUtil.MULTI_INPUTS_COUNTER_GROUP);
@Override public void attachOutputs(Map<String, LogicalOutput> outputs, Configuration conf) throws ExecException { LogicalOutput logicalOut = outputs.get(outputKey); if (logicalOut == null || !(logicalOut instanceof MROutput)) { throw new ExecException("POStoreTez only accepts MROutput. key = " + getOperatorKey() + ", outputs = " + outputs); } output = (MROutput) logicalOut; try { writer = output.getWriter(); } catch (IOException e) { throw new ExecException(e); } // Even if there is a single hdfs output, we add multi store counter // Makes it easier for user to see records for a particular store from // the DAG counter CounterGroup multiStoreGroup = processorContext.getCounters() .getGroup(MRPigStatsUtil.MULTI_STORE_COUNTER_GROUP); if (multiStoreGroup == null) { processorContext.getCounters().addGroup( MRPigStatsUtil.MULTI_STORE_COUNTER_GROUP, MRPigStatsUtil.MULTI_STORE_COUNTER_GROUP); } String name = MRPigStatsUtil.getMultiStoreCounterName(this); if (name != null) { outputRecordCounter = multiStoreGroup.addCounter(name, name, 0); } }
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(), counterProto.getDisplayName()); counter.setValue(counterProto.getValue()); } } return counters; }
Constants.COUNTER_GROUP_DISPLAY_NAME, groupName); CounterGroup group = counters.addGroup(groupName, groupDisplayName);