@@ -57,12 +57,8 @@ private[spark] class SparkSubmitArguments(args: Seq[String]) {
5757 var pyFiles : String = null
5858 val sparkProperties : HashMap [String , String ] = new HashMap [String , String ]()
5959
60- parseOpts(args.toList)
61- mergeSparkProperties()
62- checkRequiredArguments()
63-
64- /** Return default present in the currently defined defaults file. */
65- def getDefaultSparkProperties = {
60+ /** Default properties present in the currently defined defaults file. */
61+ lazy val defaultSparkProperties : HashMap [String , String ] = {
6662 val defaultProperties = new HashMap [String , String ]()
6763 if (verbose) SparkSubmit .printStream.println(s " Using properties file: $propertiesFile" )
6864 Option (propertiesFile).foreach { filename =>
@@ -79,6 +75,10 @@ private[spark] class SparkSubmitArguments(args: Seq[String]) {
7975 defaultProperties
8076 }
8177
78+ parseOpts(args.toList)
79+ mergeSparkProperties()
80+ checkRequiredArguments()
81+
8282 /**
8383 * Fill in any undefined values based on the default properties file or options passed in through
8484 * the '--conf' flag.
@@ -107,7 +107,8 @@ private[spark] class SparkSubmitArguments(args: Seq[String]) {
107107 }
108108 }
109109
110- val properties = getDefaultSparkProperties
110+ val properties = HashMap [String , String ]()
111+ properties.putAll(defaultSparkProperties)
111112 properties.putAll(sparkProperties)
112113
113114 // Use properties file as fallback for values which have a direct analog to
@@ -213,7 +214,7 @@ private[spark] class SparkSubmitArguments(args: Seq[String]) {
213214 | verbose $verbose
214215 |
215216 |Default properties from $propertiesFile:
216- | ${getDefaultSparkProperties .mkString(" " , " \n " , " \n " )}
217+ | ${defaultSparkProperties .mkString(" " , " \n " , " \n " )}
217218 """ .stripMargin
218219 }
219220
0 commit comments