You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/07/25 09:04:54 UTC

[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3137: [KYUUBI #3136] Make application info stable

ulysses-you commented on code in PR #3137:
URL: https://github.com/apache/incubator-kyuubi/pull/3137#discussion_r928638171


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ApplicationOperation.scala:
##########
@@ -55,21 +56,55 @@ trait ApplicationOperation {
    * Get the engine/application status by the unique application tag
    *
    * @param tag the unique application tag for engine instance.
-   * @return a map contains the application status
+   * @return [[ApplicationInfo]]
    */
-  def getApplicationInfoByTag(tag: String): Map[String, String]
+  def getApplicationInfoByTag(tag: String): ApplicationInfo
 }
 
-object ApplicationOperation {
+object ApplicationState extends Enumeration {
+  type ApplicationState = Value
+  val PENDING, RUNNING, FINISHED, KILLED, FAILED, NOT_FOUND = Value
 
-  /**
-   * identifier determined by cluster manager for the engine
-   */
-  val APP_ID_KEY = "id"
-  val APP_NAME_KEY = "name"
-  val APP_STATE_KEY = "state"
-  val APP_URL_KEY = "url"
-  val APP_ERROR_KEY = "error"
+  def fromName(name: String): ApplicationState = name.toUpperCase match {
+    // k8s has some different status string
+    case "WAITING" => PENDING
+    case "DELETED" => KILLED
+    case "TERMINATED" => FINISHED
+    case "TERMINATING" => FINISHED
+    case "COMPLETED" => FINISHED
+    case "ERROR" => FAILED
+    case other => withName(other)

Review Comment:
   this is a small bug fix that make kubernetes application status same with other



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org