Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4214#discussion_r23649795
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -43,9 +47,31 @@ private[history] class FsHistoryProvider(conf: 
SparkConf) extends ApplicationHis
     
       private val NOT_STARTED = "<Not Started>"
     
    +  // One day
    +  private val DEFAULT_SPARK_HISTORY_FS_CLEANER_INTERVAL_S = Duration(1, 
TimeUnit.DAYS).toSeconds
    +
    +  // One week
    +  private val DEFAULT_SPARK_HISTORY_FS_MAXAGE_S = Duration(7, 
TimeUnit.DAYS).toSeconds
    +
    +  private def warnUpdateInterval(key: String, value: String): String = {
    +    logWarning(s"Using $key to set interval " +
    +      "between each check for event log updates is deprecated, " +
    +      "please use spark.history.fs.update.interval.seconds instead.")
    +    value
    +  }
    +
       // Interval between each check for event log updates
    -  private val UPDATE_INTERVAL_MS = 
conf.getInt("spark.history.fs.updateInterval",
    -    conf.getInt("spark.history.updateInterval", 10)) * 1000
    +  private val UPDATE_INTERVAL_MS = 
conf.getOption("spark.history.fs.update.interval.seconds")
    +    .orElse(conf.getOption("spark.history.fs.updateInterval")
    +    .map(warnUpdateInterval("spark.history.fs.updateInterval", _)))
    --- End diff --
    
    Just for neatness, I'd have a single method that does both 
`conf.getOption()` and `.map()`:
    
       private def getDeprecatedConfig(conf: SparkConf, key: String): 
Option[String]
    
    Then just do:
    
        
conf.getOption(newKey).orElse(getDeprecatedKey(old1)).orElse(getDeprecatedKey(old2))


---
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

Reply via email to