map
public class MyMapper extends Mapper<LongWritable, Text, Text, LongWritable> {
@Override
protected void map(LongWritable inKey, Text inValue, Context context)
throws IOException, InterruptedException {
//逻辑实现
}
}
reduce
public class MyReducer extends Reducer<Text, LongWritable,Text, LongWritable>{
@Override
protected void reduce(Text inKey, LongWritable inValue,Context context)
throws IOException, InterruptedException {
//逻辑实现
}
}
runner
public static void main(String[] args) throws Exception {
Job job = Job.getInstance();
job.setJarByClass(Driver.class);
job.set...
}