Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private[spark] class AppStatusListener(

import config._

private val sparkVersion = SPARK_VERSION
private var sparkVersion = SPARK_VERSION
private var appInfo: v1.ApplicationInfo = null
private var appSummary = new AppSummary(0, 0)
private var coresPerTask: Int = 1
Expand Down Expand Up @@ -90,6 +90,11 @@ private[spark] class AppStatusListener(
}
}

override def onOtherEvent(event: SparkListenerEvent): Unit = event match {
case SparkListenerLogStart(version) => sparkVersion = version
case _ =>
}

override def onApplicationStart(event: SparkListenerApplicationStart): Unit = {
assert(event.appId.isDefined, "Application without IDs are not supported.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter {
test("scheduler events") {
val listener = new AppStatusListener(store, conf, true)

listener.onOtherEvent(SparkListenerLogStart("TestSparkVersion"))

// Start the application.
time += 1
listener.onApplicationStart(SparkListenerApplicationStart(
Expand All @@ -125,6 +127,7 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter {
assert(attempt.endTime.getTime() === -1L)
assert(attempt.sparkUser === "user")
assert(!attempt.completed)
assert(attempt.appSparkVersion === "TestSparkVersion")
}

// Start a couple of executors.
Expand Down