大多数 Hadoop MapReduce 程序是这样的:
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);
}
}
的用途是Configured
什么?As Tool
and Configured
both have getConf()
and setConf()
in common。它为我们的应用程序提供了什么?