Skip to content

Instantly share code, notes, and snippets.

@cworks
Created April 28, 2013 02:31
Show Gist options
  • Save cworks/5475626 to your computer and use it in GitHub Desktop.
Save cworks/5475626 to your computer and use it in GitHub Desktop.
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