In Hadoop we can increment the counter in map/reduce task using this:
context.getCounter(MyCountersEnum.SomeCounter).increment(1);
and then, the value is available in the log file.
Suppose I want to access them from code after the job completes, which Hadoop API should I use to read the counter value?