You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/22 19:27:57 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31297: [SPARK-34206][K8S] Make Guava Cache to ExecutorPodsLifecycleManager private field

dongjoon-hyun commented on a change in pull request #31297:
URL: https://github.com/apache/spark/pull/31297#discussion_r562858983



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsLifecycleManager.scala
##########
@@ -33,18 +35,22 @@ import org.apache.spark.util.Utils
 private[spark] class ExecutorPodsLifecycleManager(
     val conf: SparkConf,
     kubernetesClient: KubernetesClient,
-    snapshotsStore: ExecutorPodsSnapshotsStore,
-    // Use a best-effort to track which executors have been removed already. It's not generally
-    // job-breaking if we remove executors more than once but it's ideal if we make an attempt
-    // to avoid doing so. Expire cache entries so that this data structure doesn't grow beyond
-    // bounds.
-    removedExecutorsCache: Cache[java.lang.Long, java.lang.Long]) extends Logging {
+    snapshotsStore: ExecutorPodsSnapshotsStore) extends Logging {
 
   import ExecutorPodsLifecycleManager._
 
   private lazy val shouldDeleteExecutors = conf.get(KUBERNETES_DELETE_EXECUTORS)
   private lazy val missingPodDetectDelta = conf.get(KUBERNETES_EXECUTOR_MISSING_POD_DETECT_DELTA)
 
+  // Use a best-effort to track which executors have been removed already. It's not generally
+  // job-breaking if we remove executors more than once but it's ideal if we make an attempt
+  // to avoid doing so. Expire cache entries so that this data structure doesn't grow beyond
+  // bounds.
+  private lazy val removedExecutorsCache =
+    CacheBuilder.newBuilder()
+      .expireAfterWrite(3, TimeUnit.MINUTES)
+      .build[java.lang.Long, java.lang.Long]()

Review comment:
       This is moved with no change from `KubernetesClusterManager` to here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org