Skip to content

Instantly share code, notes, and snippets.

@JoeyAndres
Created October 22, 2017 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeyAndres/6807fe1aee6a8c05ae2d4816c763c248 to your computer and use it in GitHub Desktop.
Save JoeyAndres/6807fe1aee6a8c05ae2d4816c763c248 to your computer and use it in GitHub Desktop.
package HadoopF1.OverallTeamRaceResult;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
public class OverallTeamRaceResultReducer extends Reducer<Text, IntWritable, Text, IntWritable> {
@Override
public void reduce(Text key, Iterable<IntWritable> values, Context context)
throws IOException, InterruptedException {
int sumFinish = 0;
for (IntWritable value : values) {
sumFinish += value.get();
}
context.write(key, new IntWritable(sumFinish));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment