pan3793 commented on code in PR #4625:
URL: https://github.com/apache/kyuubi/pull/4625#discussion_r1153186168


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala:
##########
@@ -17,30 +17,55 @@
 
 package org.apache.kyuubi.engine
 
-import java.util
+import java.util.concurrent.{ConcurrentHashMap, TimeUnit}
 
-import io.fabric8.kubernetes.api.model.Pod
+import com.google.common.cache.{Cache, CacheBuilder, RemovalNotification}
 import io.fabric8.kubernetes.client.KubernetesClient
+import io.fabric8.kubernetes.client.informers.ResourceEventHandler
+import io.fabric8.kubernetes.client.informers.SharedIndexInformer
 
 import org.apache.kyuubi.Logging
 import org.apache.kyuubi.config.KyuubiConf
-import org.apache.kyuubi.engine.ApplicationState.{ApplicationState, FAILED, 
FINISHED, PENDING, RUNNING, UNKNOWN}
-import 
org.apache.kyuubi.engine.KubernetesApplicationOperation.{toApplicationState, 
SPARK_APP_ID_LABEL}
+import org.apache.kyuubi.engine.ApplicationState.{isTerminated, 
ApplicationState, FAILED, FINISHED, NOT_FOUND, PENDING, RUNNING, UNKNOWN}
+import 
org.apache.kyuubi.engine.KubernetesApplicationOperation.{toApplicationState, 
LABEL_KYUUBI_UNIQUE_KEY, SPARK_APP_ID_LABEL}
 import org.apache.kyuubi.util.KubernetesUtils
 
 class KubernetesApplicationOperation extends ApplicationOperation with Logging 
{
 
+  import io.fabric8.kubernetes.api.model.Pod
+

Review Comment:
   why change it?



##########
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala:
##########
@@ -1171,6 +1171,14 @@ object KyuubiConf {
       .booleanConf
       .createWithDefault(false)
 
+  val KUBERNETES_INFORMER_CACHE_PERIOD: ConfigEntry[Long] =
+    buildConf("kyuubi.kubernetes.informer.cache.period")
+      .doc("The time kyuubi server hold app info after the app ends.")
+      .version("1.8.0")
+      .timeConf
+      .checkValue(_ > 0, "must be positive number")
+      .createWithDefault(Duration.ofSeconds(60).toMillis)

Review Comment:
   ```suggestion
       val KUBERNETES_TERMINATED_APPLICATION_RETAIN_PERIOD: ConfigEntry[Long] =
       buildConf("kyuubi.kubernetes.terminatedApplicationRetainPeriod")
         .doc("The period for which the Kyuubi server retains application 
information after " +
           "the application terminates.")
         .version("1.8.0")
         .timeConf
         .checkValue(_ > 0, "must be positive number")
         .createWithDefault(Duration.ofMinutes(5).toMillis)
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to