Skip to content

Commit

Permalink
[SPARK-6046] Privatize SparkConf.translateConfKey
Browse files Browse the repository at this point in the history
The warning of deprecated configs is actually done when the configs are set, not when they are get. As a result we don't need to explicitly call `translateConfKey` outside of `SparkConf` just to print the warning again in vain.

Author: Andrew Or <[email protected]>

Closes apache#4797 from andrewor14/warn-deprecated-config and squashes the following commits:

8fb43e6 [Andrew Or] Privatize SparkConf.translateConfKey
  • Loading branch information
Andrew Or committed Feb 27, 2015
1 parent 4a8a0a8 commit 7c99a01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/SparkConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ private[spark] object SparkConf extends Logging {
* @param warn Whether to print a warning if the key is deprecated. Warnings will be printed
* only once for each key.
*/
def translateConfKey(userKey: String, warn: Boolean = false): String = {
private def translateConfKey(userKey: String, warn: Boolean = false): String = {
deprecatedConfigs.get(userKey)
.map { deprecatedKey =>
if (warn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis

// Interval between each check for event log updates
private val UPDATE_INTERVAL_MS = conf.getOption("spark.history.fs.update.interval.seconds")
.orElse(conf.getOption(SparkConf.translateConfKey("spark.history.fs.updateInterval", true)))
.orElse(conf.getOption(SparkConf.translateConfKey("spark.history.updateInterval", true)))
.orElse(conf.getOption("spark.history.fs.updateInterval"))
.orElse(conf.getOption("spark.history.updateInterval"))
.map(_.toInt)
.getOrElse(10) * 1000

Expand Down

0 comments on commit 7c99a01

Please sign in to comment.