太难了!!有没有大佬教教我!!!!!Eclipse根本没什么反应!!!!
啥年代了还用eclipse,
骚年,试试idea吧
真香
package com.hpu.hadoop.test;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import java.io.IOException;
/**
* @author zyn
* @version 1.0
*/
public class TMapper extends Mapper<LongWritable, Text,Text, NullWritable> {
private int lineNum = 0;
@Override
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
lineNum++;
context.write(value,NullWritable.get());
}
@Override
protected void cleanup(Context context) throws IOException, InterruptedException {
System.out.println("------------"+lineNum);
}
}