-
Notifications
You must be signed in to change notification settings - Fork 1
/
Min.java
33 lines (30 loc) · 1.06 KB
/
Min.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
32
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;
// Busca el mínimo de una columna para conjuntos masivos de datos.
public class Min {
public static void main(String[] args) throws IOException {
if (args.length != 2) {
System.err.println("Usage: Min <input path> <output path>");
System.exit(-1);
}
JobConf conf = new JobConf(Min.class);
conf.setJobName("Min Column");
FileInputFormat.addInputPath(conf, new Path(args[0]));
FileOutputFormat.setOutputPath(conf, new Path(args[1]));
// La clase del Mapper
conf.setMapperClass(MinMapper.class);
// La clase del Reducer
conf.setReducerClass(MinReducer.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
JobClient.runJob(conf);
}
}