2012-02-24 128 views

回答

4

在作业的主要功能中,作业完成后,您可以以编程方式从作业中获取计数器,然后将其保存到HDFS中。
所以你的代码在主要看起来像这样:

... 
job.waitForCompleteion(); 
// read counters looks something like this: 
Counters c = job.getCounters(); 
Counter cnt = c.findCounter("YouCounterName"); 
// counter has getName() and getValue() methods  
... 
// save to hdfs 
... 
相关问题