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


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala:
##########
@@ -140,13 +144,37 @@ class KyuubiRestFrontendService(override val serverable: 
Serverable)
     batchChecker.scheduleWithFixedDelay(task, interval, interval, 
TimeUnit.MILLISECONDS)
   }
 
+  private def batchV2Enabled(reqConf: Map[String, String]): Boolean = {
+    KyuubiServer.kyuubiServer.getConf.get(BATCH_SUBMITTER_ENABLED) &&
+    reqConf.getOrElse(BATCH_IMPL_VERSION.key, getConf.get(BATCH_IMPL_VERSION)) 
== "2"
+  }
+
   @VisibleForTesting
   private[kyuubi] def recoverBatchSessions(): Unit = {
     val recoveryNumThreads = conf.get(METADATA_RECOVERY_THREADS)
     val batchRecoveryExecutor =
       ThreadUtils.newDaemonFixedThreadPool(recoveryNumThreads, 
"batch-recovery-executor")
     try {
-      val batchSessionsToRecover = 
sessionManager.getBatchSessionsToRecover(connectionUrl)
+      // split metadata wait to recover as v1 and v2

Review Comment:
   the code is clear enough to show **what we are doing**, the comment should 
explain "why should we do it"



##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala:
##########
@@ -140,13 +144,37 @@ class KyuubiRestFrontendService(override val serverable: 
Serverable)
     batchChecker.scheduleWithFixedDelay(task, interval, interval, 
TimeUnit.MILLISECONDS)
   }
 
+  private def batchV2Enabled(reqConf: Map[String, String]): Boolean = {
+    KyuubiServer.kyuubiServer.getConf.get(BATCH_SUBMITTER_ENABLED) &&
+    reqConf.getOrElse(BATCH_IMPL_VERSION.key, getConf.get(BATCH_IMPL_VERSION)) 
== "2"
+  }
+
   @VisibleForTesting
   private[kyuubi] def recoverBatchSessions(): Unit = {
     val recoveryNumThreads = conf.get(METADATA_RECOVERY_THREADS)
     val batchRecoveryExecutor =
       ThreadUtils.newDaemonFixedThreadPool(recoveryNumThreads, 
"batch-recovery-executor")
     try {
-      val batchSessionsToRecover = 
sessionManager.getBatchSessionsToRecover(connectionUrl)
+      // split metadata wait to recover as v1 and v2

Review Comment:
   the code is clear enough to show **what we are doing**, the comment should 
explain **why should we do it**



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