Created
November 21, 2017 08:18
-
-
Save sajithdilshan/a3f8ab91668cd706ad9ff64c6468b318 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
Configuration conf = new Configuration(); | |
conf.set("fs.defaultFS", "hdfs://localhost:9000"); | |
Job job = Job.getInstance(conf, "word count"); | |
job.setJarByClass(VisitorPathCount.class); | |
job.setMapperClass(TokenizerMapper.class); | |
job.setCombinerClass(IntSumReducer.class); | |
job.setReducerClass(IntSumReducer.class); | |
job.setOutputKeyClass(Text.class); | |
job.setOutputValueClass(IntWritable.class); | |
FileInputFormat.addInputPath(job, new Path("/s3logs")); | |
FileOutputFormat.setOutputPath(job, new Path("/tmp/result.txt")); | |
System.exit(job.waitForCompletion(true) ? 0 : 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment