/**
* Mocks the Reporter.incrCounter, but adds buffering.
* See org.apache.hadoop.mapred.Reporter's incrCounter.
*/
public void incrCounter(String group, String counterName, long incr) {
PigStatusReporter reporter = PigStatusReporter.getInstance();
if (reporter != null && reporter.incrCounter(group, counterName, incr)) { // common case
if (counterStringMap_.size() > 0) {
for (Map.Entry<Pair<String, String>, Long> entry : counterStringMap_.entrySet()) {
reporter.incrCounter(entry.getKey().first, entry.getKey().second, entry.getValue());
}
counterStringMap_.clear();
}
return;
}