Vote count:
0
I have exactly the same question as: Accessing a mapper's counter from a reducer
I.e., I want to get the value of a custom Counter that was used in a Mapper, from my Reducer.
The suggested solution:
// in the Reducer class...
private long mapperCounter;
public void configure(JobConf conf) {
JobClient client = new JobClient(conf);
RunningJob parentJob = client.getJob(JobID.forName( conf.get("mapred.job.id") ));
mapperCounter = parentJob.getCounters().getCounter(MAP_COUNTER_NAME);
}
does not work for me (using Hadoop 1.2.0), since I get a NullPointerException in the final line. getCounters()
returns null.
asked 2 mins ago
Aucun commentaire:
Enregistrer un commentaire