-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoste.java
More file actions
35 lines (24 loc) · 1.05 KB
/
Copy pathPoste.java
File metadata and controls
35 lines (24 loc) · 1.05 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
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;
public class Poste {
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
String[] ourArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
Job job = Job.getInstance(conf, "Bureaux de poste");
job.setJarByClass(Poste.class);
job.setMapperClass(PosteMap.class);
job.setReducerClass(PosteReduce.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
FileInputFormat.addInputPath(job, new Path(ourArgs[0]));
FileOutputFormat.setOutputPath(job, new Path(ourArgs[1]));
if (job.waitForCompletion(true))
System.exit(0);
System.exit(-1);
}
}