Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2379#discussion_r17745188
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala ---
    @@ -47,14 +48,25 @@ private[spark] class WorkerArguments(args: 
Array[String], conf: SparkConf) {
       if (System.getenv("SPARK_WORKER_WEBUI_PORT") != null) {
         webUiPort = System.getenv("SPARK_WORKER_WEBUI_PORT").toInt
       }
    -  if (conf.contains("spark.worker.ui.port")) {
    -    webUiPort = conf.get("spark.worker.ui.port").toInt
    -  }
       if (System.getenv("SPARK_WORKER_DIR") != null) {
         workDir = System.getenv("SPARK_WORKER_DIR")
       }
     
       parse(args.toList)
    +  propertiesFile = 
Option(propertiesFile).getOrElse(Utils.getDefaultConfigFile)
    +
    +  Option(propertiesFile).foreach { file =>
    +    Utils.getPropertiesFromFile(file).filter { case (k, v) =>
    +      k.startsWith("spark.")
    +    }.foreach { case (k, v) =>
    +      conf.setIfMissing(k, v)
    +      sys.props.getOrElseUpdate(k, v)
    +    }
    +  }
    --- End diff --
    
    That makes the call sites too complicated for my taste (since all of them 
need to deal with "what's the default config file" and "how to load properties 
into a map"), but no strong opinion. 
    
    Since this method is already so single-purpose (load properties into an 
existing SparkConf), I feel like my suggestion makes things cleaner.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to