simon824 commented on a change in pull request #1119:
URL: https://github.com/apache/incubator-kyuubi/pull/1119#discussion_r720362254
##########
File path:
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
##########
@@ -148,6 +149,26 @@ trait ProcBuilder {
proc
}
+ val YARN_APP_NAME_REGEX: Regex = "application_\\d+_\\d+".r
+
+ def killApplication(line: String = lastRowOfLog): String =
+ YARN_APP_NAME_REGEX.findFirstIn(line) match {
+ case Some(appId) =>
+ val pb = new ProcessBuilder("/bin/sh",
+ System.getProperty("user.dir") + "/bin/stop-application.sh", appId)
+
+ pb.environment()
+ .putAll(env.asJava)
+ pb.redirectError(engineLog)
+ pb.redirectOutput(engineLog)
+ val process = pb.start()
+ process.waitFor() match {
+ case id if id != 0 => "Failed to kill Application, please kill it
manually. "
+ case _ => "Killed Application successfully. "
Review comment:
Done
--
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]