[
https://issues.apache.org/jira/browse/HADOOP-12803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15174289#comment-15174289
]
Jason Lowe commented on HADOOP-12803:
-------------------------------------
The main issue with using a new parameter is differentiating it from the
arbitrary program arguments. We'd have to name it such that there is as close
to zero chance as possible it would collide with any other parameter that could
be in use. Also there's the issue of positioning of the parameter -- we'd have
to make it clear it's only supported in a very specific place in the cmdline or
support scanning the arbitrary arguments for it and removing it once found.
How would the conf property work in practice? Kind of annoying to use if it
cannot be specified on the command line, and if we support specifying it on the
command line then we're basically back at the first option of providing a new
parameter.
Another option is to provide a utility jar that in turn takes another jar and
main class as arguments. In other words, instead of:
{noformat}
hadoop jar myjar.jar themainclass and some custom args here
{noformat}
we could do something like this:
{noformat}
hadoop jar $HADOOP_PREFIX/share/hadoop/tools/hadoop-runjar-shim.jar myjar.jar
themainclass and some custom args here
{noformat}
and we could further simplify usage by adding a new subcommand that selects it
automatically, e.g.: (note "runjar" instead of "jar")
{noformat}
hadoop runjar myjar.jar themainclass and some custom args here
{noformat}
Not thrilled with having two different subcommands to run jars, but it does
have the advantage of eliminating any potential of argument collision and would
only have to be used in the case of needing to override a jar's
manifest-specified main class.
> RunJar should allow overriding the manifest Main-Class via a cli parameter.
> ---------------------------------------------------------------------------
>
> Key: HADOOP-12803
> URL: https://issues.apache.org/jira/browse/HADOOP-12803
> Project: Hadoop Common
> Issue Type: Bug
> Components: util
> Affects Versions: 2.6.4
> Reporter: Gera Shegalov
> Assignee: Gera Shegalov
> Attachments: HADOOP-12803.001.patch
>
>
> Currently there is no way to override the main class in the manifest even
> though main class can be passed as a parameter.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)