AFFogarty commented on a change in pull request #303:
URL: https://github.com/apache/incubator-livy/pull/303#discussion_r472452018



##########
File path: server/src/main/scala/org/apache/livy/utils/SparkApp.scala
##########
@@ -19,17 +19,28 @@ package org.apache.livy.utils
 
 import scala.collection.JavaConverters._
 
+import com.fasterxml.jackson.core.`type`.TypeReference
+import com.fasterxml.jackson.module.scala.JsonScalaEnumeration
+
 import org.apache.livy.LivyConf
+import org.apache.livy.utils.SparkApp.StateTypeReference
 
 object AppInfo {
   val DRIVER_LOG_URL_NAME = "driverLogUrl"
   val SPARK_UI_URL_NAME = "sparkUiUrl"
+  val APP_STATE_NAME = "appState"
 }
 
-case class AppInfo(var driverLogUrl: Option[String] = None, var sparkUiUrl: 
Option[String] = None) {
+case class AppInfo(
+    var driverLogUrl: Option[String] = None,
+    var sparkUiUrl: Option[String] = None,
+    @JsonScalaEnumeration(classOf[StateTypeReference])
+    var appState: Option[SparkApp.State] = None) {
   import AppInfo._
   def asJavaMap: java.util.Map[String, String] =
-    Map(DRIVER_LOG_URL_NAME -> driverLogUrl.orNull, SPARK_UI_URL_NAME -> 
sparkUiUrl.orNull).asJava
+    Map(DRIVER_LOG_URL_NAME -> driverLogUrl.orNull,
+      SPARK_UI_URL_NAME -> sparkUiUrl.orNull,
+      APP_STATE_NAME -> appState.map(s => s.toString).orNull).asJava

Review comment:
       Fixed




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to