Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
sunchao committed May 31, 2024
1 parent 94fe365 commit a86e2f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
var executorCores: String = null
var totalExecutorCores: String = null
var propertiesFile: String = null
private var extraPropertiesFiles: Boolean = false
private var loadSparkDefaults: Boolean = false
var driverMemory: String = null
var driverExtraClassPath: String = null
var driverExtraLibraryPath: String = null
Expand Down Expand Up @@ -137,8 +137,8 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
// Also load properties from `spark-defaults.conf` if they do not exist in the properties file
// and --conf list when:
// - no input properties file is specified
// - input properties file is specified, but `--extra-properties-files` flag is set
if (propertiesFile == null || extraPropertiesFiles) {
// - input properties file is specified, but `--load-spark-defaults` flag is set
if (propertiesFile == null || loadSparkDefaults) {
loadPropertiesFromFile(Utils.getDefaultPropertiesFile(env))
}
}
Expand Down Expand Up @@ -397,8 +397,8 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
case PROPERTIES_FILE =>
propertiesFile = value

case EXTRA_PROPERTIES_FILES =>
extraPropertiesFiles = true
case LOAD_SPARK_DEFAULTS =>
loadSparkDefaults = true

case KILL_SUBMISSION =>
submissionToKill = value
Expand Down Expand Up @@ -543,7 +543,7 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
| --conf, -c PROP=VALUE Arbitrary Spark configuration property.
| --properties-file FILE Path to a file from which to load extra properties. If not
| specified, this will look for conf/spark-defaults.conf.
| --extra-properties-files Whether to load properties from conf/spark-defaults.conf,
| --load-spark-defaults Whether to load properties from conf/spark-defaults.conf,
| even if --properties-file is specified.
|
| --driver-memory MEM Memory for driver (e.g. 1000M, 2G) (Default: ${mem_mb}M).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ class SparkSubmitSuite
}
}

test("SPARK-48392: load spark-defaults.conf when --extra-properties-files is set") {
test("SPARK-48392: load spark-defaults.conf when --load-spark-defaults is set") {
forConfDir(Map("spark.executor.memory" -> "3g", "spark.driver.memory" -> "3g")) { path =>
withPropertyFile("spark-conf.properties",
Map("spark.executor.cores" -> "16", "spark.driver.memory" -> "4g")) { propsFile =>
Expand All @@ -1123,7 +1123,7 @@ class SparkSubmitSuite
"--name", "testApp",
"--master", "local",
"--properties-file", propsFile,
"--extra-properties-files",
"--load-spark-defaults",
unusedJar.toString)
val appArgs = new SparkSubmitArguments(args, env = Map("SPARK_CONF_DIR" -> path))
appArgs.executorCores should be("16")
Expand All @@ -1133,7 +1133,7 @@ class SparkSubmitSuite
}
}

test("SPARK-48392: should skip spark-defaults.conf when --extra-properties-files is not set") {
test("SPARK-48392: should skip spark-defaults.conf when --load-spark-defaults is not set") {
forConfDir(Map("spark.executor.memory" -> "3g", "spark.driver.memory" -> "3g")) { path =>
withPropertyFile("spark-conf.properties",
Map("spark.executor.cores" -> "16", "spark.driver.memory" -> "4g")) { propsFile =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SparkSubmitOptionParser {
protected final String PACKAGES = "--packages";
protected final String PACKAGES_EXCLUDE = "--exclude-packages";
protected final String PROPERTIES_FILE = "--properties-file";
protected final String EXTRA_PROPERTIES_FILES = "--extra-properties-files";
protected final String LOAD_SPARK_DEFAULTS = "--load-spark-defaults";
protected final String PROXY_USER = "--proxy-user";
protected final String PY_FILES = "--py-files";
protected final String REPOSITORIES = "--repositories";
Expand Down Expand Up @@ -131,7 +131,7 @@ class SparkSubmitOptionParser {
{ USAGE_ERROR },
{ VERBOSE, "-v" },
{ VERSION },
{ EXTRA_PROPERTIES_FILES },
{ LOAD_SPARK_DEFAULTS },
};

/**
Expand Down

0 comments on commit a86e2f8

Please sign in to comment.