Exemple #1
0
 public void reduce(Text key, Iterable<IntWritable> values, Context context)
     throws IOException, InterruptedException {
   int sum = 0;
   for (IntWritable val : values) {
     sum++;
   }
   context.write(new IntWritable(sum), NullWritable.get());
 }
 public void reduce(StockRecord key, Iterable<NullWritable> values, Context context)
     throws IOException, InterruptedException {
   context.write(key, NullWritable.get());
 }
 @Override
 protected void map(LongWritable key, StockRecord value, Context context)
     throws IOException, InterruptedException {
   context.write(value, NullWritable.get());
 }