-
Notifications
You must be signed in to change notification settings - Fork 29.3k
SPARK-1619 Launch spark-shell with spark-submit #542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,12 @@ object SparkSubmit { | |
|
|
||
| private var clusterManager: Int = LOCAL | ||
|
|
||
| /** | ||
| * A special jar name that indicates the class being run is inside of Spark itself, | ||
| * and therefore no user jar is needed. | ||
| */ | ||
| private val reservedJarName = "spark-internal" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RESERVED_JAR_NAME because it's a constant? Or am I stuck in Java land?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ya I'll change this. I think we are sort of inconsistent on this in the code base, but we don't typically use ALL_CAPS for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we do in a few cases where it's a constant that multiple classes are accessing. |
||
|
|
||
| def main(args: Array[String]) { | ||
| val appArgs = new SparkSubmitArguments(args) | ||
| if (appArgs.verbose) { | ||
|
|
@@ -113,7 +119,7 @@ object SparkSubmit { | |
|
|
||
| if (!deployOnCluster) { | ||
| childMainClass = appArgs.mainClass | ||
| childClasspath += appArgs.primaryResource | ||
| if (appArgs.primaryResource != reservedJarName) childClasspath += appArgs.primaryResource | ||
| } else if (clusterManager == YARN) { | ||
| childMainClass = "org.apache.spark.deploy.yarn.Client" | ||
| childArgs += ("--jar", appArgs.primaryResource) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -963,8 +963,9 @@ class SparkILoop(in0: Option[BufferedReader], protected val out: JPrintWriter, | |
| val master = this.master match { | ||
| case Some(m) => m | ||
| case None => { | ||
| val prop = System.getenv("MASTER") | ||
| if (prop != null) prop else "local[*]" | ||
| val envMaster = sys.env.get("MASTER") | ||
| val propMaster = sys.props.get("spark.master") | ||
| envMaster.getOrElse(propMaster.getOrElse("local[*]")) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mind = blown |
||
| } | ||
| } | ||
| master | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone who types "spark-shell --help" will hit the message? Is this info useful to the user? I think I would be a little confused by what "Its" refers to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I actually wanted to make this clear to users, but maybe it's just annoying? I guess we could just not print this.