Ejemplo n.º 1
0
 public void reduce(KeyWritable key, Iterable<BytesWritable> values, Context ctx)
     throws IOException, InterruptedException {
   for (BytesWritable value : values) {
     long startTime = System.currentTimeMillis();
     ctx.write(key, value);
     long elapsedTime = System.currentTimeMillis() - startTime;
     ctx.getCounter(Counters.ELAPSED_TIME_MS).increment(elapsedTime);
     ctx.getCounter(Counters.NUM_CELLS).increment(1);
   }
 }