Hadoop GenericOptionsParser

GenericOptionsParser is used in ToolRunner to parse out the generic options, -conf, -D, -jt, -files, -libjars, -archives and set these generic options in the job configuration accordingly. Any leftover remaining command options will then be passed to our mapreduce job by calling the run(toolArgs).

String[] toolArgs = parser.getRemainingArgs();  //get any remaining command options other than the generic options

return tool.run(toolArgs);

Since our mapreduce job implements the run(String[] args) method, we will get passed all the remaining command options and can use them for configuring our job.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s