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:35:52 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #3137: [KYUUBI #3136] Change Map to a case class ApplicationInfo as the application info holder

yaooqinn commented on code in PR #3137:
URL: https://github.com/apache/incubator-kyuubi/pull/3137#discussion_r928666830


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

Review Comment:
   where is submitted/new/accepted/failed etc



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