Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
History Server: updated order for multiple attempts(descending start …
…time)
  • Loading branch information
rekhajoshm committed Jul 12, 2015
commit 83306a8bc1749974fd60edf441843ea9a93c3520
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)

/**
* Comparison function that defines the sort order for application attempts within the same
* application. Order is: completed attempts before running attempts, running attempts sorted
* by ascending start time,completed attempts sorted by ascending end time.
* application. Order is: completed attempts before running attempts, if both completed
* or both running attempts sorted by descending start time.
*
* Normally applications should have a single running attempt; but failure to call sc.stop()
* may cause multiple running attempts to show up.
Expand All @@ -425,7 +425,7 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
a1: FsApplicationAttemptInfo,
a2: FsApplicationAttemptInfo): Boolean = {
if (a1.completed == a2.completed) {
if (a1.completed) a1.endTime <= a2.endTime else a1.startTime <= a2.startTime
a1.startTime >= a2.startTime
} else {
a1.completed
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class FsHistoryProviderSuite extends SparkFunSuite with BeforeAndAfter with Matc
updateAndCheck(provider) { list =>
list.size should be (1)
list.head.attempts.size should be (2)
list.head.attempts.head.attemptId should be (Some("attempt1"))
list.head.attempts.head.attemptId should be (Some("attempt2"))
}

val attempt3 = newLogFile("app1", Some("attempt3"), inProgress = false)
Expand All @@ -289,7 +289,7 @@ class FsHistoryProviderSuite extends SparkFunSuite with BeforeAndAfter with Matc
}

val app2Attempt1 = newLogFile("app2", Some("attempt1"), inProgress = false)
writeFile(attempt2, true, None,
writeFile(attempt1, true, None,
SparkListenerApplicationStart("app2", Some("app2"), 5L, "test", Some("attempt1")),
SparkListenerApplicationEnd(6L)
)
Expand Down