コード例 #1
0
ファイル: WordCount.java プロジェクト: patanric/Assignment2
 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());
 }
コード例 #2
0
 public void reduce(StockRecord key, Iterable<NullWritable> values, Context context)
     throws IOException, InterruptedException {
   context.write(key, NullWritable.get());
 }
コード例 #3
0
 @Override
 protected void map(LongWritable key, StockRecord value, Context context)
     throws IOException, InterruptedException {
   context.write(value, NullWritable.get());
 }