0

Similar to Hadoop Mapreduce, Hama also has Counters as explained in this link.

In hadoop mapreduce, retrieving the value of a Counter is as simple as follows using the getCounters() function:

long value = job.getCounters().findCounter(SomeEnumClass.PROPERTY).getValue();

However, in hama's BSPJob class, it does not have such a getCounters() function.

cannot find symbol
symbol  : method getCounters()
location: class org.apache.hama.bsp.BSPJob
      long value = bsp.getCounters().findCounter(
                         ^
1 error

So my question is: After a hama BSPJob has finished, how can I retrieve the value from a Counter?

Thank you,

keelar
  • 5,814
  • 7
  • 40
  • 79
  • 1
    Frankly I think you will need to add a feature request (issues.apache.org/jira/browse/HAMA). – Thomas Jungblut Nov 05 '13 at 06:47
  • @Thomas OMG ... I know you're an expert on Hama, and if you don't think there is a way .. then that means there might not be such a way .. :(. So is there any workaround? – keelar Nov 05 '13 at 06:53
  • 1
    I don't have the latest release on disk, but it looks like we simply forgot to add this. So I guess you will need to parse it from the log output. But please double check with the dev team. – Thomas Jungblut Nov 05 '13 at 06:55
  • Originally I tried something like `bsp.getJobClient().getJob().getStatus().getCounter().findCounter()`, but it turns out that `getJobClient()` is package-private .... – keelar Nov 05 '13 at 06:57
  • You can add a proxy in the hama package in your project and access it from there. Although that is not very convenient. – Thomas Jungblut Nov 05 '13 at 07:09
  • In that case I will think about submit a solution to hama (in case I do it right) :p – keelar Nov 05 '13 at 07:13

0 Answers0