Skip to content

Commit

Permalink
History Server: updated order for multiple attempts(descending start …
Browse files Browse the repository at this point in the history
…time works everytime)
  • Loading branch information
rekhajoshm committed Jul 13, 2015
1 parent 83306a8 commit 548c753
Showing 1 changed file with 3 additions and 7 deletions.
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, if both completed
* or both running attempts sorted by descending start time.
* application. Order is: later attempts before earlier attempts.
* The most recent attempt state matches with current state of the app.
*
* Normally applications should have a single running attempt; but failure to call sc.stop()
* may cause multiple running attempts to show up.
Expand All @@ -424,11 +424,7 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
private def compareAttemptInfo(
a1: FsApplicationAttemptInfo,
a2: FsApplicationAttemptInfo): Boolean = {
if (a1.completed == a2.completed) {
a1.startTime >= a2.startTime
} else {
a1.completed
}
a1.startTime >= a2.startTime
}

/**
Expand Down

0 comments on commit 548c753

Please sign in to comment.