Github user archit279thakur commented on a diff in the pull request: https://github.com/apache/spark/pull/6263#discussion_r44892842 --- Diff: core/src/main/scala/org/apache/spark/storage/StorageStatusListener.scala --- @@ -28,15 +36,33 @@ import org.apache.spark.scheduler._ * * This class is thread-safe (unlike JobProgressListener) */ + +object StorageStatusListener { + val TIME_TO_EXPIRE_KILLED_EXECUTOR = "spark.ui.timeToExpireKilledExecutor" +} + @DeveloperApi -class StorageStatusListener extends SparkListener { +class StorageStatusListener private[storage](conf: SparkConf, ticker: Ticker) { + def this(conf: SparkConf) = { + this(conf, Ticker.systemTicker()) + } + + import StorageStatusListener._ + // This maintains only blocks that are cached (i.e. storage level is not StorageLevel.NONE) private[storage] val executorIdToStorageStatus = mutable.Map[String, StorageStatus]() + private[storage] val removedExecutorIdToStorageStatus = CacheBuilder.newBuilder(). + expireAfterWrite(conf.getTimeAsSeconds(TIME_TO_EXPIRE_KILLED_EXECUTOR, "0"), TimeUnit.SECONDS). + ticker(ticker).build[String, StorageStatus]() --- End diff -- I was accessing it in tests, so kept it private[storage]. I can make it private and addition of new tests, (if require) can make it private[storage] ?
--- 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