- MapReduce , Sort.java. Hadoop Map , . - :
public static class Map extends Mapper<LongWritable,Text,IntWritable,Text>{
private Text word = new Text();
public void map(LongWritable key, Text value, Context context) throws IO Exception, Interrupted Exception{
String line = value.toString();
StringTokenizer tokenizer = new StringTokenizer(line);
word.set(tokenizer.nextToken());
IntWritable number = new IntWritable(Integer.parseInt(tokenizer.nextToken()));
context.write(number,word);
}
}
[LongWritable, text] MapReduce LongWritable. , !
CL