My original question
since only possible ans to this question is in This question AND answer in the old API. To make me pose a stupid question translating this line into the New API :
private long mapperCounter; @Override 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); }
Note. I want this code in the reducer to have access to the following functions:
@Override protected void setup(Context context) throws IOException, InterruptedException { } @Override protected void cleanup(Context context) throws IOException, InterruptedException { } @Override public void run(Context context) throws IOException, InterruptedException { Job job=new Job(context.getConfiguration()); } @Override public void reduce(ImmutableBytesWritable key,Iterable<ImmutableBytesWritable> result,Context context ) { }
Thanks:):)
source share