In Hadoop we can increment counter in map/reduce task, it looks like this:
... context.getCounter(MyCountersEnum.SomeCounter).increment(1); ...
I just found the answer here.
You need a job object to access the counters:
Counters counters = job.getCounters(); Counter counter = counters.findCounter(MyCountersEnum.SomeCounter); System.out.println(counter.getDisplayName() + ": " + counter.getValue());