大多数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);
}
}
Run Code Online (Sandbox Code Playgroud)
有什么用Configured?由于Tool和Configured都有getConf()和setConf()共同点.它为我们的应用程序提供了什么?