-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUrlDayIpDriver.java
31 lines (25 loc) · 994 Bytes
/
UrlDayIpDriver.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
28
29
30
31
//package test;
import org.apache.hadoop.fs.Path;
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 UrlDayIpDriver {
public void run(String[] args) throws Exception {
JobConf conf = new JobConf();
conf.setJarByClass(UrlDayIpMapper.class);
conf.setJobName(getClass().getCanonicalName());
conf.setMapperClass(UrlDayIpMapper.class);
conf.setReducerClass(UrlDayIpReducer.class);
conf.setMapOutputKeyClass(Text.class);
conf.setOutputKeyClass(Text.class);
FileInputFormat.setInputPaths(conf, new Path(args[0]));
FileOutputFormat.setOutputPath(conf, new Path(args[1]));
JobClient.runJob(conf);
}
public static void main(String[] args) throws Exception {
UrlDayIpDriver udi = new UrlDayIpDriver();
udi.run(args);
}
}