meisten Hadoop MapReduce-Programme wie diese sind:Was die Verwendung von Konfiguriert Klasse in Hadoop-Programmen ist
public class MyApp extends Configured Implements Tool {
@Override
public int run(String[] args) throws Exception {
Job job = new Job(getConf());
/* process command line options */
return job.waitForCompletion(true) ? 0 : 1;
}
public static void main(String[] args) throws Exception {
int exitCode = ToolRunner.run(new MyApp(), args);
System.exit(exitCode);
}
}
Was die Verwendung von Configured
ist? Als Tool
und Configured
haben beide getConf()
und setConf()
gemeinsam. Was liefert es unserer Anwendung?