Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/18555#discussion_r126274186 --- Diff: core/src/main/scala/org/apache/spark/internal/config/package.scala --- @@ -51,29 +63,66 @@ package object config { ConfigBuilder(SparkLauncher.EXECUTOR_EXTRA_LIBRARY_PATH).stringConf.createOptional private[spark] val EXECUTOR_USER_CLASS_PATH_FIRST = - ConfigBuilder("spark.executor.userClassPathFirst").booleanConf.createWithDefault(false) + ConfigBuilder("spark.executor.userClassPathFirst") + .doc("Same functionality as spark.driver.userClassPathFirst, " + + "but applied to executor instances.") + .booleanConf + .checkValues(Set(false, true)) + .createWithDefault(false) private[spark] val EXECUTOR_MEMORY = ConfigBuilder("spark.executor.memory") + .doc("Amount of memory to use per executor process (e.g. 2g, 8g).") .bytesConf(ByteUnit.MiB) + .checkValue(v => v > 0 && v <= Int.MaxValue / (1024 * 1024), + "The executor memory must be greater than 0M " + + s"and less than ${Int.MaxValue / (1024 * 1024)}M.") .createWithDefaultString("1g") - private[spark] val IS_PYTHON_APP = ConfigBuilder("spark.yarn.isPython").internal() - .booleanConf.createWithDefault(false) + private[spark] val IS_PYTHON_APP = ConfigBuilder("spark.yarn.isPython") + .internal() + .booleanConf + .checkValues(Set(false, true)) + .createWithDefault(false) - private[spark] val CPUS_PER_TASK = ConfigBuilder("spark.task.cpus").intConf.createWithDefault(1) + private[spark] val CPUS_PER_TASK = ConfigBuilder("spark.task.cpus") + .doc("Number of cores to allocate for each task. ") + .intConf + .checkValue(v => v > 0, + "Number of cores to allocate for task event queue must not be negative") + .createWithDefault(1) private[spark] val DYN_ALLOCATION_MIN_EXECUTORS = - ConfigBuilder("spark.dynamicAllocation.minExecutors").intConf.createWithDefault(0) + ConfigBuilder("spark.dynamicAllocation.minExecutors") + .doc("Lower bound for the number of executors if dynamic allocation is enabled.") + .intConf + .checkValue(v => v >= 0, + "Lower bound for the number of executors should be greater than or equal to 0") + .createWithDefault(0) private[spark] val DYN_ALLOCATION_INITIAL_EXECUTORS = ConfigBuilder("spark.dynamicAllocation.initialExecutors") + .doc("Initial number of executors to run if dynamic allocation is enabled. " + + "If `--num-executors` (or `spark.executor.instances`) is set " + + "and larger than this value, " + + "it will be used as the initial number of executors.") .fallbackConf(DYN_ALLOCATION_MIN_EXECUTORS) private[spark] val DYN_ALLOCATION_MAX_EXECUTORS = - ConfigBuilder("spark.dynamicAllocation.maxExecutors").intConf.createWithDefault(Int.MaxValue) + ConfigBuilder("spark.dynamicAllocation.maxExecutors") + .doc("Upper bound for the number of executors if dynamic allocation is enabled. ") + .intConf + .createWithDefault(Int.MaxValue) private[spark] val SHUFFLE_SERVICE_ENABLED = - ConfigBuilder("spark.shuffle.service.enabled").booleanConf.createWithDefault(false) + ConfigBuilder("spark.shuffle.service.enabled") + .doc("Enables the external shuffle service. This service preserves " + + "the shuffle files written by executors so the executors can be safely removed. " + + "This must be enabled if spark.dynamicAllocation.enabled is 'true'. " + + "The external shuffle service must be set up in order to enable it. " + + "See dynamic allocation configuration and setup documentation for more information. ") + .booleanConf + .checkValues(Set(false, true)) --- End diff -- ditto
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org