-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDesv.java
28 lines (27 loc) · 965 Bytes
/
Desv.java
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
package oldapi;
import java.io.IOException;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
public class Desv {
public static void main(String[] args) throws IOException {
if (args.length != 2) {
System.err.println("Usage: Desv <input path> <output path>");
System.exit(-1);
}
JobConf conf = new JobConf(Desv.class);
conf.setJobName("Desv");
FileInputFormat.addInputPath(conf, new Path(args[0]));
FileOutputFormat.setOutputPath(conf, new Path(args[1]));
conf.setMapperClass(DesvMapper.class);
conf.setReducerClass(DesvReducer.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
JobClient.runJob(conf);
}
}