if (CollectionUtils.isEmpty(execs) || contribution == null) {
return;
}
for (ExecJob execJob : execs) {
PigStats stats = execJob.getStatistics();
// embedded pig contains no stats and further more throws Exceptions
// use CDH3 compatible comparison
if (stats != null && !stats.getClass().getName().contains("EmbeddedPigStats")) {
// compute the input stats manually
List<InputStats> inputStats = stats.getInputStats();
for (InputStats is : inputStats) {
for (int i = 0; i < safeLongToInt(is.getNumberRecords()); i++) {
contribution.incrementReadCount();
}
}
contribution.incrementWriteCount(safeLongToInt(stats.getRecordWritten()));
// Skip information not available yet
// workaround: query the internal map/reduce jobs ?
//contribution.incrementReadSkipCount(safeLongToInt(count.getValue()));
//