How to get the mapper output byte counter

坚强是说给别人听的谎言 提交于 2019-12-11 08:50:01

问题


I am chaining an undetermined amount of map reduce jobs together for a parallel BFS shortest path algorithm and when the path cannot be determined, my jobs loop infinitely without producing any records. I figured the best way to check this is to get the Map Output Bytes counter that is maintained by hadoop.

How can I get access to this counter?


回答1:


To get the map output bytes counter produced by the job, use

long outputBytes = job.getCounters().findCounter("org.apache.hadoop.mapred.Task$Counter", "MAP_OUTPUT_BYTES").getValue();

See http://lintool.github.io/Cloud9/docs/content/counters.html for more counter groups and names



来源:https://stackoverflow.com/questions/18995543/how-to-get-the-mapper-output-byte-counter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!