Created
April 28, 2013 02:31
-
-
Save cworks/5475626 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
import org.apache.hadoop.io.LongWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Mapper; | |
public final class PlayerBattingMapper extends Mapper<LongWritable, Text, Text, Text> { | |
/* | |
* The map method runs once for each line of text in the input file. The method receives a key | |
* of type LongWritable, a value of type Text, and a Context object. | |
*/ | |
@Override | |
public void map(LongWritable key, Text value, Context context) | |
throws IOException, InterruptedException { | |
// logic to deal with the line of text (value variable) goes here | |
// emit key, value | |
context.write(new Text(battingData[0]), new Text(sb.toString())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment