Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/5840#discussion_r29881622
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala ---
@@ -122,27 +129,97 @@ private[ui] class BatchPage(parent: StreamingTab)
extends WebUIPage("batch") {
</tr>
}
- private def generateOutputOpIdRow(
- outputOpId: OutputOpId, sparkJobs: Seq[JobUIData]): Seq[Node] = {
- val sparkjobDurations = sparkJobs.map(sparkJob => {
- sparkJob.submissionTime.map { start =>
- val end =
sparkJob.completionTime.getOrElse(System.currentTimeMillis())
- end - start
+ /**
+ * If a job is dropped by sparkListener due to exceeding the limitation,
we only show the job id
+ * with "-" cells.
+ */
+ private def generateDroppedJobRow(
+ outputOpId: OutputOpId,
+ outputOpDescription: Seq[Node],
+ formattedOutputOpDuration: String,
+ numSparkJobRowsInOutputOp: Int,
+ isFirstRow: Boolean,
+ jobId: Int): Seq[Node] = {
+ // In the first row, output op id and its information needs to be
shown. In other rows, these
+ // cells will be taken up due to "rowspan".
+ // scalastyle:off
+ val prefixCells =
+ if (isFirstRow) {
+ <td class="output-op-id-cell"
rowspan={numSparkJobRowsInOutputOp.toString}>{outputOpId.toString}</td>
+ <td
rowspan={numSparkJobRowsInOutputOp.toString}>{outputOpDescription}</td>
+ <td
rowspan={numSparkJobRowsInOutputOp.toString}>{formattedOutputOpDuration}</td>
+ } else {
+ Nil
}
- })
+ // scalastyle:on
+
+ <tr>
+ {prefixCells}
+ <td sorttable_customkey={jobId.toString}>
+ {jobId.toString}
+ </td>
+ <!-- Duration -->
+ <td>-</td>
+ <!-- Stages: Succeeded/Total -->
+ <td>-</td>
+ <!-- Tasks (for all stages): Succeeded/Total -->
+ <td>-</td>
+ <!-- Error -->
+ <td>-</td>
+ </tr>
+ }
+
+ private def generateOutputOpIdRow(
+ outputOpId: OutputOpId, sparkJobs: Seq[SparkJobIdWithUIData]):
Seq[Node] = {
+ // We don't count the durations of dropped jobs
+ val sparkJobDurations =
sparkJobs.filter(_.jobUIData.nonEmpty).map(_.jobUIData.get).
+ map(sparkJob => {
+ sparkJob.submissionTime.map { start =>
+ val end =
sparkJob.completionTime.getOrElse(System.currentTimeMillis())
+ end - start
+ }
+ })
val formattedOutputOpDuration =
- if (sparkjobDurations.exists(_ == None)) {
- // If any job does not finish, set "formattedOutputOpDuration" to
"-"
+ if (sparkJobDurations.isEmpty || sparkJobDurations.exists(_ ==
None)) {
+ // If no job or any job does not finish, set
"formattedOutputOpDuration" to "-"
"-"
} else {
- SparkUIUtils.formatDuration(sparkjobDurations.flatMap(x => x).sum)
+ SparkUIUtils.formatDuration(sparkJobDurations.flatMap(x => x).sum)
}
- generateJobRow(outputOpId, formattedOutputOpDuration, sparkJobs.size,
true, sparkJobs.head) ++
+
+ val description = generateOutputOpDescription(sparkJobs)
+
+ generateJobRow(
+ outputOpId, description, formattedOutputOpDuration, sparkJobs.size,
true, sparkJobs.head) ++
sparkJobs.tail.map { sparkJob =>
- generateJobRow(outputOpId, formattedOutputOpDuration,
sparkJobs.size, false, sparkJob)
+ generateJobRow(
+ outputOpId, description, formattedOutputOpDuration,
sparkJobs.size, false, sparkJob)
}.flatMap(x => x)
}
+ private def generateOutputOpDescription(sparkJobs:
Seq[SparkJobIdWithUIData]): Seq[Node] = {
+ val lastStageInfo =
+ sparkJobs.flatMap(_.jobUIData).headOption. // Get the first JobUIData
+ // Get the latest Stage info
+ flatMap { sparkJob =>
--- End diff --
nit: This is a little weird to read with the continuous line havnig a line
of comment in the middle. took 5 seconds to realize that this is a continuation
line.
---
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]