/// <exception cref="System.IO.IOException"/> /// <exception cref="System.Exception"/> protected override void Reduce(Text key, IEnumerable <IntWritable> values, Reducer.Context context) { context.GetCounter("MyCounterGroup", "REDUCE_INPUT_GROUPS").Increment(1); int sum = 0; foreach (IntWritable val in values) { sum += val.Get(); } result.Set(sum); context.Write(key, result); context.GetCounter("MyCounterGroup", "REDUCE_OUTPUT_RECORDS").Increment(1); }