wordCount的认识(java版)

来源:互联网 发布:fs forse.js 编辑:程序博客网 时间:2024/05/21 15:40

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...}
0 0