Guest User

Untitled

a guest
Nov 22nd, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public static void main(String[] args) throws Exception {
  2. Configuration conf = new Configuration();
  3. conf.set("fs.defaultFS", "hdfs://localhost:9000");
  4. Job job = Job.getInstance(conf, "word count");
  5. job.setJarByClass(VisitorPathCount.class);
  6. job.setMapperClass(TokenizerMapper.class);
  7. job.setCombinerClass(IntSumReducer.class);
  8. job.setReducerClass(IntSumReducer.class);
  9. job.setOutputKeyClass(Text.class);
  10. job.setOutputValueClass(IntWritable.class);
  11. FileInputFormat.addInputPath(job, new Path("/s3logs"));
  12. FileOutputFormat.setOutputPath(job, new Path("/tmp/result.txt"));
  13. System.exit(job.waitForCompletion(true) ? 0 : 1);
  14. }
Add Comment
Please, Sign In to add comment