-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAvgWordLength.java
More file actions
61 lines (61 loc) · 1.92 KB
/
AvgWordLength.java
File metadata and controls
61 lines (61 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//package edu.easternct.bigdata.stubs;
//import org.apache.hadoop.fs.Path;
//import org.apache.hadoop.io.Text;
//import org.apache.hadoop.io.IntWritable;
//import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
//import org.apache.hadoop.mapreduce.Job;
//import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
//
//public class AvgWordLength {
//
// public static void main(String[] args) throws Exception {
//
// /*
// * Validate that two arguments were passed from the command line.
// */
// if (args.length != 2) {
// System.out.printf("Usage: AvgWordLength <input dir> <output dir>\n");
// System.exit(-1);
// }
//
// /*
// * Instantiate a Job object for your job's configuration.
// */
// @SuppressWarnings("deprecation")
// Job job = new Job();
//
// /*
// * Specify the jar file that contains your driver, mapper, and reducer.
// * Hadoop will transfer this jar file to nodes in your cluster running
// * mapper and reducer tasks.
// */
// job.setJarByClass(AvgWordLength.class);
//
// /*
// * Specify an easily-decipherable name for the job.
// * This job name will appear in reports and logs.
// */
// job.setJobName("Average Word Length");
//
// /*
// * TODO implement
// */
// FileInputFormat.setInputPaths(job, new Path(args[0]));
// FileOutputFormat.setOutputPath(job, new Path(args[1]));
// job.setMapperClass(LetterMapper.class);
// job.setReducerClass(AverageReducer.class);
//
// job.setMapOutputKeyClass(Text.class);
// job.setMapOutputValueClass(IntWritable.class);
//
// job.setOutputKeyClass(Text.class);
// job.setOutputValueClass(IntWritable.class);
// /*
// * Start the MapReduce job and wait for it to finish.
// * If it finishes successfully, return 0. If not, return 1.
// */
// boolean success = job.waitForCompletion(true);
// System.exit(success ? 0 : 1);
// }
//}
//