-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-7504] [YARN] NullPointerException when initializing SparkContext in YARN-cluster mode #6083
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 5 commits
9f287c5
39e4fa3
4924e01
ea2a5fe
7c89b6e
926bd96
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 |
|---|---|---|
|
|
@@ -448,6 +448,15 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging { | |
| } | ||
| } | ||
| } | ||
|
|
||
| // System property spark.yarn.app.id must be set if user code ran by AM on a YARN cluster | ||
| // yarn-standalone is deprecated, but still supported | ||
| if ((get("spark.master") == "yarn-cluster" || get("spark.master") == "yarn-standalone") && | ||
|
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.
I don't see any method named
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. There are two
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. Oh my bad. I thought this was still in SparkContext. In fact, I think the check should be there. When I mentioned "check 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. What we do here is actually an act of validating the configuration. It seems to be a good place inside
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.
|
||
| get("spark.yarn.app.id", null) == null) { | ||
| throw new SparkException("Detected yarn-cluster mode, but isn't running on a cluster. " + | ||
| "Deployment to YARN is not supported directly by SparkContext. Please use spark-submit.") | ||
| } | ||
|
|
||
| } | ||
|
|
||
| /** | ||
|
|
||
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.
I can probably remove this on merge, but there's a stray blank here.
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.
As I saw, usually there is a blank line before ending of long methods and classes. You might remove it if you will.