package org.hackreduce.examples;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.hackreduce.mappers.BixiMapper;
import org.hackreduce.models.BixiRecord;

/**
 *
 */
public class Stage2Reducer extends Reducer<Text, CityYearRecord, Text,CityYearRecord> {
ationReduce
	 
	 
	   public void reduce(Key key, Iterable<CityYearRecord> values, 
	                      Context context) throws IOException {
	     int sum = 0;
	     for (CityYearRecord val : values) {
	       sum += val.getCount();
	     }
	     String year = key.
	     CityYearRecord result = new CityYearRecord(,,sum) ;
	     context.collect(year, result);
	   }
	 }
}
