Skip to content

Commit

Permalink
add appSparkVersion for Rest API to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanket committed Apr 26, 2017
1 parent bad5ea2 commit 5f6e80b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ private[spark] object ApplicationsListResource {
sparkUser = internalAttemptInfo.sparkUser,
completed = internalAttemptInfo.completed
)
}
},
appSparkVersion = org.apache.spark.SPARK_VERSION
)
}
}
3 changes: 2 additions & 1 deletion core/src/main/scala/org/apache/spark/status/api/v1/api.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class ApplicationInfo private[spark](
val maxCores: Option[Int],
val coresPerExecutor: Option[Int],
val memoryPerExecutorMB: Option[Int],
val attempts: Seq[ApplicationAttemptInfo])
val attempts: Seq[ApplicationAttemptInfo],
val appSparkVersion: String)

class ApplicationAttemptInfo private[spark](
val attemptId: Option[String],
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/scala/org/apache/spark/ui/SparkUI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ private[spark] class SparkUI private (
lastUpdated = new Date(startTime),
sparkUser = "",
completed = false
))
)),
appSparkVersion = appSparkVersion
))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class ApplicationCacheSuite extends SparkFunSuite with Logging with MockitoSugar
ended: Long): SparkUI = {
val info = new ApplicationInfo(name, name, Some(1), Some(1), Some(1), Some(64),
Seq(new AttemptInfo(attemptId, new Date(started), new Date(ended),
new Date(ended), ended - started, "user", completed)))
new Date(ended), ended - started, "user", completed)), org.apache.spark.SPARK_VERSION)
val ui = mock[SparkUI]
when(ui.getApplicationInfoList).thenReturn(List(info).iterator)
when(ui.getAppName).thenReturn(name)
Expand Down

0 comments on commit 5f6e80b

Please sign in to comment.