Github user jiangxb1987 commented on a diff in the pull request:
https://github.com/apache/spark/pull/21454#discussion_r191582499
--- Diff: core/src/main/scala/org/apache/spark/SparkConf.scala ---
@@ -394,23 +407,35 @@ class SparkConf(loadDefaults: Boolean) extends
Cloneable with Logging with Seria
}
- /** Get a parameter as an integer, falling back to a default if not set
*/
- def getInt(key: String, defaultValue: Int): Int = {
+ /**
+ * Get a parameter as an integer, falling back to a default if not set
+ * @throws IllegalArgumentException If the value can't be interpreted as
an integer
+ */
+ def getInt(key: String, defaultValue: Int): Int =
catchIllegalArgument(key) {
getOption(key).map(_.toInt).getOrElse(defaultValue)
}
- /** Get a parameter as a long, falling back to a default if not set */
- def getLong(key: String, defaultValue: Long): Long = {
+ /**
+ * Get a parameter as a long, falling back to a default if not set
+ * @throws IllegalArgumentException If the value can't be interpreted as
an long
--- End diff --
nit: `an long` -> `a long`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]