Created
October 22, 2017 05:54
-
-
Save JoeyAndres/6807fe1aee6a8c05ae2d4816c763c248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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