Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
8113c55d
Commit
8113c55d
authored
11 years ago
by
Evan Chan
Browse files
Options
Downloads
Patches
Plain Diff
[Feedback] Get rid of -m, set MASTER from SPARK_MASTER_IP/PORT automagically
parent
8dd78f80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spark-shell
+13
-12
13 additions, 12 deletions
spark-shell
with
13 additions
and
12 deletions
spark-shell
+
13
−
12
View file @
8113c55d
#!/bin/bash --posix
#
# Shell script for starting the Spark Shell REPL
# Note that it will set MASTER to spark://${SPARK_MASTER_IP}:${SPARK_MASTER_PORT}
# if those two env vars are set in spark-env.sh but MASTER is not.
# Options:
# -m Set MASTER to spark://$SPARK_MASTER_IP:$SPARK_MASTER_PORT
# -c <cores> Set the number of cores for REPL to use
#
FWDIR
=
"
`
dirname
$0
`
"
for
o
in
"
$@
"
;
do
if
[
"
$1
"
=
"-m"
-o
"
$1
"
=
"--master"
]
;
then
shift
if
[
-e
"
$FWDIR
/conf/spark-env.sh"
]
;
then
.
"
$FWDIR
/conf/spark-env.sh"
fi
if
[
-z
"
$MASTER
"
]
;
then
MASTER
=
"spark://
${
SPARK_MASTER_IP
}
:
${
SPARK_MASTER_PORT
}
"
fi
export
MASTER
fi
if
[
"
$1
"
=
"-c"
-o
"
$1
"
=
"--cores"
]
;
then
shift
if
[
-n
"
$1
"
]
;
then
...
...
@@ -28,6 +18,17 @@ for o in "$@"; do
fi
done
# Set MASTER from spark-env if possible
if
[
-z
"
$MASTER
"
]
;
then
if
[
-e
"
$FWDIR
/conf/spark-env.sh"
]
;
then
.
"
$FWDIR
/conf/spark-env.sh"
fi
if
[[
"x"
!=
"x
$SPARK_MASTER_IP
"
&&
"y"
!=
"y
$SPARK_MASTER_PORT
"
]]
;
then
MASTER
=
"spark://
${
SPARK_MASTER_IP
}
:
${
SPARK_MASTER_PORT
}
"
export
MASTER
fi
fi
# Copy restore-TTY-on-exit functions from Scala script so spark-shell exits properly even in
# binary distribution of Spark where Scala is not installed
exit_status
=
127
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment