wForget commented on code in PR #6008:
URL: https://github.com/apache/kyuubi/pull/6008#discussion_r1496867993


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/AdminResource.scala:
##########
@@ -255,24 +260,44 @@ private[v1] class AdminResource extends ApiRequestContext 
with Logging {
     }
     val engine = normalizeEngineInfo(userName, engineType, shareLevel, 
subdomain, "default")
     val engineSpace = calculateEngineSpace(engine)
+    var msg = s"Engine $engineSpace is deleted successfully."
+    if (forceKill) {
+      if (StringUtils.isBlank(refId)) {
+        throw new IllegalArgumentException(s"Invalid refId: $refId")
+      }
 
-    withDiscoveryClient(fe.getConf) { discoveryClient =>
-      val engineNodes = discoveryClient.getChildren(engineSpace)
-      engineNodes.foreach { node =>
-        val nodePath = s"$engineSpace/$node"
-        info(s"Deleting engine node:$nodePath")
-        try {
-          discoveryClient.delete(nodePath)
-        } catch {
-          case e: Exception =>
-            error(s"Failed to delete engine node:$nodePath", e)
-            throw new NotFoundException(s"Failed to delete engine 
node:$nodePath," +
-              s"${e.getMessage}")
+      val applicationManagerInfo = ApplicationManagerInfo(
+        Option(sparkMaster),
+        Option(sparK8Context),
+        Option(sparK8Namespace))
+
+      var killMessage: KillResponse = (false, "UNKNOWN")
+      killMessage = fe.be.sessionManager.asInstanceOf[KyuubiSessionManager]

Review Comment:
   > killMessage need to be assigned a new value next line. Could we keep var 
here ?
   
   which line?



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