Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> Re: GenericOptionsParser


Copy link to this message
-
Re: GenericOptionsParser
On 3 October 2012 18:38, Koert Kuipers <[EMAIL PROTECTED]> wrote:

> Why does GenericOptionParser also remove -Dprop=value options (without
> setting the system properties)? Those are not hadoop options but java
> options.
For the same reason Ant, maven and other tools do -they have a notion that
you are setting parameters for your application & not the process.
> And why does hadoop jar not accept -Dprop=value before the class name, as
> java does? like "hadoop jar -Dprop=value class"
>
> How do i set java system properties with hadoop jar?
> Thx! Koert
>
The real problem there is that the processes you are trying to tweak may be
remote and running, so local system properties (java.home ... ) aren't
likely to be of any help.

If you do want to set jvm properties, you are free to extend your
ToolRunner subclass to go through the property list and selectively add
them, e.g scan for all properties with jvm.sysprop.something=vale, and call
System.setProperty("something","value), though at that point it may be too
late for some options.

-Steve