Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/2342#discussion_r28727537
--- Diff: core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala ---
@@ -17,18 +17,137 @@
package org.apache.spark.ui.jobs
-import scala.xml.{Node, NodeSeq}
+import scala.xml.{Node, NodeSeq, Unparsed}
+import java.util.Date
import javax.servlet.http.HttpServletRequest
-import org.apache.spark.ui.{WebUIPage, UIUtils}
+import org.apache.spark.ui.{UIUtils, WebUIPage}
import org.apache.spark.ui.jobs.UIData.JobUIData
+import org.apache.spark.JobExecutionStatus
/** Page showing list of all ongoing and recently finished jobs */
private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
private val startTime: Option[Long] = parent.sc.map(_.startTime)
private val listener = parent.listener
+ private def applicationTimelineView(jobs: Seq[JobUIData], now: Long):
Seq[Node] = {
+ val jobEventJsonAsStrSeq = jobs.flatMap { jobUIData =>
+ val jobId = jobUIData.jobId
+ val status = jobUIData.status
+ val submissionTimeOpt = jobUIData.submissionTime
+ val completionTimeOpt = jobUIData.completionTime
+
+ if (status == JobExecutionStatus.UNKNOWN ||
submissionTimeOpt.isEmpty ||
+ completionTimeOpt.isEmpty && status != JobExecutionStatus.RUNNING)
{
+ None
+ }
+
+ val submissionTime = submissionTimeOpt.get
+ val completionTime = completionTimeOpt.getOrElse(now)
+ val classNameByStatus = status match {
+ case JobExecutionStatus.SUCCEEDED => "succeeded"
+ case JobExecutionStatus.FAILED => "failed"
+ case JobExecutionStatus.RUNNING => "running"
+ }
+
+ val jobEventJsonAsStr =
+ s"""
+ |{
+ | 'className': 'job application-timeline-object
${classNameByStatus}',
+ | 'group': 'jobs',
+ | 'start': new Date(${submissionTime}),
+ | 'end': new Date(${completionTime}),
+ | 'content': '<div class="application-timeline-content">Job
${jobId}</div>',
+ | 'title': 'Job ${jobId}\\nStatus: ${status}\\n' +
--- End diff --
Can this use the Job description (then say the Job ID in parentheses)?
Also, can there be a link that will take you back to the job if you click on
it? If you need to add anchor tags for each entry in the jobs table... that's
fine.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]