これらは一般的なオプションと呼ばれます。したがって、それらをサポートするには、ジョブでツールを実装する必要があります。
次のようにジョブを実行します --
hadoop jar yourfile.jar [mainClass] args -libjars <comma seperated list of jars>
編集:
Toolを実装してConfiguredを拡張するには、MapReduce アプリケーションで次のようにします --
public class YourClass extends Configured implements Tool {
public static void main(String[] args) throws Exception {
int res = ToolRunner.run(new YourClass(), args);
System.exit(res);
}
public int run(String[] args) throws Exception
{
//parse you normal arguments here.
Configuration conf = getConf();
Job job = new Job(conf, "Name of job");
//set the class names etc
//set the output data type classes etc
//to accept the hdfs input and outpur dir at run time
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
return job.waitForCompletion(true) ? 0 : 1;
}
}