return sb.toString();
}
@SuppressWarnings("deprecation")
void addCounters(RunningJob rjob) {
Counters counters = null;
if (rjob != null) {
try {
counters = rjob.getCounters();
} catch (IOException e) {
LOG.warn("Unable to get job counters", e);
}
}
if (counters != null) {
Counters.Group taskgroup = counters
.getGroup(PigStatsUtil.TASK_COUNTER_GROUP);
Counters.Group hdfsgroup = counters
.getGroup(PigStatsUtil.FS_COUNTER_GROUP);
Counters.Group multistoregroup = counters
.getGroup(PigStatsUtil.MULTI_STORE_COUNTER_GROUP);
Counters.Group multiloadgroup = counters
.getGroup(PigStatsUtil.MULTI_INPUTS_COUNTER_GROUP);
mapInputRecords = taskgroup.getCounterForName(
PigStatsUtil.MAP_INPUT_RECORDS).getCounter();
mapOutputRecords = taskgroup.getCounterForName(
PigStatsUtil.MAP_OUTPUT_RECORDS).getCounter();
reduceInputRecords = taskgroup.getCounterForName(
PigStatsUtil.REDUCE_INPUT_RECORDS).getCounter();
reduceOutputRecords = taskgroup.getCounterForName(
PigStatsUtil.REDUCE_OUTPUT_RECORDS).getCounter();
hdfsBytesRead = hdfsgroup.getCounterForName(
PigStatsUtil.HDFS_BYTES_READ).getCounter();
hdfsBytesWritten = hdfsgroup.getCounterForName(
PigStatsUtil.HDFS_BYTES_WRITTEN).getCounter();
spillCount = counters.findCounter(
PigCounters.SPILLABLE_MEMORY_MANAGER_SPILL_COUNT)
.getCounter();
activeSpillCountObj = counters.findCounter(
PigCounters.PROACTIVE_SPILL_COUNT_BAGS).getCounter();
activeSpillCountRecs = counters.findCounter(
PigCounters.PROACTIVE_SPILL_COUNT_RECS).getCounter();
Iterator<Counter> iter = multistoregroup.iterator();
while (iter.hasNext()) {
Counter cter = iter.next();