GitHub user vanzin opened a pull request:
https://github.com/apache/spark/pull/5841
[SPARK-6324] [core] Centralize handling of script usage messages.
Reorganize code so that the launcher library handles most of the work
of printing usage messages, instead of having an awkward protocol between
the library and the scripts for that.
This mostly applies to SparkSubmit, since the launcher lib does not do
command line parsing for classes invoked in other ways, and thus cannot
handle failures for those. Most scripts end up going through SparkSubmit,
though, so it all works.
The change adds a new, internal command line switch, "--usage-error",
which prints the usage message and exits with a non-zero status. Scripts
can override the command printed in the usage message by setting an
environment variable - this avoids having to grep the output of
SparkSubmit to remove references to the "spark-submit" script.
The only sub-optimal part of the change is the special handling for the
spark-sql usage, which is now done in SparkSubmitArguments.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/vanzin/spark SPARK-6324
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5841.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5841
----
commit 6bc1b41d0041e3d269826eb4061b5cfd1de19beb
Author: Marcelo Vanzin <[email protected]>
Date: 2015-05-01T00:20:08Z
[SPARK-6324] [core] Centralize handling of script usage messages.
Reorganize code so that the launcher library handles most of the work
of printing usage messages, instead of having an awkward protocol between
the library and the scripts for that.
This mostly applies to SparkSubmit, since the launcher lib does not do
command line parsing for classes invoked in other ways, and thus cannot
handle failures for those. Most scripts end up going through SparkSubmit,
though, so it all works.
The change adds a new, internal command line switch, "--usage-error",
which prints the usage message and exits with a non-zero status. Scripts
can override the command printed in the usage message by setting an
environment variable - this avoids having to grep the output of
SparkSubmit to remove references to the "spark-submit" script.
The only sub-optimal part of the change is the special handling for the
spark-sql usage, which is now done in SparkSubmitArguments.
commit c6609bf15e164a146b881a8c2639e515b1139b9c
Author: Marcelo Vanzin <[email protected]>
Date: 2015-05-01T02:40:00Z
Fix exit code never being used when printing usage messages.
commit bf139b5f3aca4beabcf4901cd8397945f9fd6ad5
Author: Marcelo Vanzin <[email protected]>
Date: 2015-05-01T18:30:17Z
Filter output of Spark SQL CLI help.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]