Skip to content

Commit

Permalink
Removed useless code from java_gateway.py
Browse files Browse the repository at this point in the history
Added comments in utils.py and SparkSubmitArguments.scala to notice someone that both of the files should be modified simultaneously
  • Loading branch information
sarutak committed Aug 9, 2014
1 parent 513ad2e commit 98287ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion bin/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
function gatherSparkSubmitOpts() {

if [ -z "$SUBMIT_USAGE_FUNCTION" ]; then

echo "Function for printing usage of $0 is not set." 1>&2
echo "Please set usage function to shell variable 'SUBMIT_USAGE_FUNCTION' in $0" 1>&2
exit 1
fi

# NOTE: If you add or remove spark-sumbmit options,
# modify NOT ONLY this script but also SparkSubmitArgument.scala
SUBMISSION_OPTS=()
APPLICATION_OPTS=()
while (($#)); do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ private[spark] class SparkSubmitArguments(args: Seq[String]) {
// Delineates parsing of Spark options from parsing of user options.
parse(opts)

/*
* NOTE: If you add or remove spark-submit options,
* modify NOT ONLY this file but also utils.sh
*/
def parse(opts: Seq[String]): Unit = opts match {
case ("--name") :: value :: tail =>
name = value
Expand Down
6 changes: 1 addition & 5 deletions python/pyspark/java_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ def launch_gateway():
submit_args = os.environ.get("PYSPARK_SUBMIT_ARGS")
submit_args = submit_args if submit_args is not None else ""
submit_args = shlex.split(submit_args)
application_opts = os.environ.get("APPLICATION_OPTS")
application_opts = application_opts if application_opts is not None else ""
application_opts = shlex.split(application_opts)
command = [os.path.join(SPARK_HOME, script)] + submit_args + \
["pyspark-shell"] + application_opts
command = [os.path.join(SPARK_HOME, script)] + submit_args + ["pyspark-shell"]
if not on_windows:
# Don't send ctrl-c / SIGINT to the Java gateway:
def preexec_func():
Expand Down

0 comments on commit 98287ed

Please sign in to comment.