-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-2098] All Spark processes should support spark-defaults.conf, config file #2379
Conversation
QA tests have started for PR 2379 at commit
|
QA tests have finished for PR 2379 at commit
|
I think I have an opposite view from Andrew in that I dislike using sys.props as an IPC mechanism, but other than that, looks good. |
initSecurity() | ||
new HistoryServerArguments(conf, argStrings) | ||
val arg = new HistoryServerArguments(argStrings) | ||
Option(arg.propertiesFile).foreach { file => |
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.
This block is repeated 3 times, maybe add it to Utils? Also, wonder if this would look better:
Option(arg.propertiesFile)
.map { f => Utils.getPropertiesFromFile(f) }
.foreach { props =>
props.filter { case (k, v) => k.startsWith("spark.") }
.foreach { case (k, v) => sys.props.getOrElseUpdate(k, v) }
}
@vanzin @witgo Actually my intention was not to put everything you load from the properties file into |
@andrewor14 makes sense. Yeah, that would simplify the change a lot. |
Just to make sure, a blind |
Yes thanks you would want to use that one. |
@andrewor14 @vanzin This is a very good idea, we create a SparkConf from the beginning and we will use that for the entire process. But it need to modify a lot of code ,Maybe we need to create a separate jira |
@witgo Not sure if I understand what you mean. The changes I am proposing actually changes less code (compared to Spark master), not more. Right now a problem in this PR is that the ordering between |
@@ -25,7 +25,7 @@ import org.apache.spark.SparkConf | |||
/** | |||
* Command-line parser for the worker. | |||
*/ | |||
private[spark] class WorkerArguments(args: Array[String], conf: SparkConf) { |
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 mentioned elsewhere, we shouldn't remove SparkConf
as an argument.
@witgo I have added a few more in-line comments to explain what I mean. Let me know if you have any more questions. |
217280a
to
dae0120
Compare
QA tests have started for PR 2379 at commit
|
QA tests have finished for PR 2379 at commit
|
OK, the code has been updated. |
QA tests have started for PR 2379 at commit
|
QA tests have finished for PR 2379 at commit
|
c1824d2
to
c4a77e9
Compare
QA tests have started for PR 2379 at commit
|
QA tests have started for PR 2379 at commit
|
def getDefaultPropertiesFile(): String = { | ||
sys.env.get("SPARK_CONF_DIR") | ||
.orElse(sys.env.get("SPARK_HOME").map { t => s"$t${File.separator}conf"}) | ||
.map { t => new File(s"$t${File.separator}spark-defaults.conf")} |
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.
nit: space before }
LGTM, just a couple of minor things. |
QA tests have finished for PR 2379 at commit
|
Test FAILed. |
Looks like there is a legitimate test failure though, can you resolve this @witgo? |
I just tested this on the Worker, Master and the HistoryServer and it works as expected. Awesome. |
QA tests have started for PR 2379 at commit
|
QA tests have finished for PR 2379 at commit
|
Test PASSed. |
@andrewor14 The code has been updated. |
Thanks, I will look at this shortly. A minor request though: in the future could you keep around all the commits in your branch? It would help reviewing if I could see what lines have been changed in a particular commit that was pushed after my comments, for example. |
Hey sorry @witgo there are merge conflicts now. I'll test this again and merge this once you update it. |
QA tests have started for PR 2379 at commit
|
QA tests have finished for PR 2379 at commit
|
Test PASSed. |
@andrewor14 The code has been updated. |
Alright, I'm merging this into master. Thanks @witgo! |
Cool! Thanks @andrewor14 @vanzin |
This is another implementation about #1256
cc @andrewor14 @vanzin