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.