Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/1256#discussion_r14666594
--- Diff: core/src/main/scala/org/apache/spark/SparkConf.scala ---
@@ -289,6 +298,36 @@ class SparkConf(loadDefaults: Boolean) extends
Cloneable with Logging {
* configuration out for debugging.
*/
def toDebugString: String = {
- settings.toArray.sorted.map{case (k, v) => k + "=" + v}.mkString("\n")
+ settings.toArray.sorted.map { case (k, v) => k + "=" +
v}.mkString("\n")
+ }
+
+ /** Load properties from file. */
+ private[spark] def loadPropertiesFromFile(fileName: String, isOverride:
Boolean = false) {
+ val file = new File(fileName)
+ if (file.exists() && file.isFile()) {
+ loadProperties(Utils.getPropertiesFromFile(file.getAbsolutePath),
isOverride)
+ }
+ }
+
+ /** Load properties from resource. */
+ private[spark] def loadPropertiesFromResource(resourcePath: String,
+ isOverride: Boolean = false) {
+
Option(Utils.getSparkClassLoader.getResourceAsStream(resourcePath)).foreach {
in =>
+ loadProperties(Utils.getPropertiesFromInputStream(in), isOverride)
+ }
+ }
+
+ /** Load any spark.* system properties */
+ private[spark] def loadSystemProperties(isOverride: Boolean = true) {
--- End diff --
This is only called in one place, why the argument? Seems like we always
want system properties to override other settings anyway.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---