4

My Original Question

since only feasible ans to that question is found in This Question And the answer is in old API . So that force me to put a stupid question of translating these line to 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 reducer so inherited functions available are :

            @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 :) :)

Community
  • 1
  • 1
saurabh shashank
  • 1,343
  • 2
  • 14
  • 22

1 Answers1

3

This presentation summarizes the changes between the old and new API.

Lorand Bendig
  • 10,630
  • 1
  • 38
  • 45
  • 1
    +1 for a great link to a nice overview, but golly I wish it were just text... I can't find such a concise reference anywhere else. Anyone? – hoc_age Apr 25 '14 at 19:24