gengliangwang commented on a change in pull request #32381:
URL: https://github.com/apache/spark/pull/32381#discussion_r627530249
##########
File path: core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala
##########
@@ -64,9 +68,12 @@ private[ui] class AllJobsPage(parent: JobsTab, store:
AppStatusStore) extends We
</svg></div>.toString.filter(_ != '\n')
private def makeJobEvent(jobs: Seq[v1.JobData]): Seq[String] = {
+ val now = System.currentTimeMillis()
jobs.filter { job =>
job.status != JobExecutionStatus.UNKNOWN && job.submissionTime.isDefined
- }.map { job =>
+ }.sortBy { j =>
+ (-j.completionTime.map(_.getTime).getOrElse(now),
-j.submissionTime.get.getTime)
+ }.take(MAX_TIMELINE_JOBS).map { job =>
Review comment:
nit: how about
sortBy(completionTime, submissionTime).takeRight
the negative value is not straightforward.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]