code: public void run(Context context) throws IOException, InterruptedException {
      setup(context);
      while (context.nextKey()) {
        context.progress();
        reduce(context.getCurrentKey(), context.getValues(), context);
      }
      cleanup(context);
    }
docs: Advanced application writers can use the
  {@link #run(org.apache.hadoop.mapreduce.Reducer.Context)} method to
  control how the reduce task works.