Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/19920#discussion_r155603905 --- Diff: core/src/main/scala/org/apache/spark/status/api/v1/api.scala --- @@ -24,27 +24,32 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize import org.apache.spark.JobExecutionStatus -class ApplicationInfo private[spark]( - val id: String, - val name: String, - val coresGranted: Option[Int], - val maxCores: Option[Int], - val coresPerExecutor: Option[Int], - val memoryPerExecutorMB: Option[Int], - val attempts: Seq[ApplicationAttemptInfo]) +case class ApplicationInfo private[spark]( + id: String, + name: String, + coresGranted: Option[Int], + maxCores: Option[Int], + coresPerExecutor: Option[Int], + memoryPerExecutorMB: Option[Int], + attempts: Seq[ApplicationAttemptInfo]) { + + def completed: Boolean = { + attempts.nonEmpty && attempts.head.completed + } +} @JsonIgnoreProperties( value = Array("startTimeEpoch", "endTimeEpoch", "lastUpdatedEpoch"), allowGetters = true) -class ApplicationAttemptInfo private[spark]( - val attemptId: Option[String], - val startTime: Date, - val endTime: Date, - val lastUpdated: Date, - val duration: Long, - val sparkUser: String, - val completed: Boolean = false, - val appSparkVersion: String) { +case class ApplicationAttemptInfo private[spark]( --- End diff -- Same.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org