@@ -31,17 +31,14 @@ private[ui] class StreamingPagedTable(
3131 batches : Seq [BatchUIData ],
3232 basePath : String ,
3333 subPath : String ,
34- isRunningTable : Boolean ,
35- isWaitingTable : Boolean ,
36- isCompletedTable : Boolean ,
3734 batchInterval : Long ) extends PagedTable [BatchUIData ] {
3835
3936 private val (sortColumn, desc, pageSize) = getTableParameters(request, tableTag, " Batch Time" )
4037 private val parameterPath = s " $basePath/ $subPath/? ${getParameterOtherTable(request, tableTag)}"
4138 private val encodedSortColumn = URLEncoder .encode(sortColumn, UTF_8 .name())
4239
4340 private val firstFailureReason : Option [String ] =
44- if (! isWaitingTable ) {
41+ if (! tableTag.equals( " waitingBatches " ) ) {
4542 getFirstFailureReason(batches)
4643 } else {
4744 None
@@ -64,13 +61,17 @@ private[ui] class StreamingPagedTable(
6461 }
6562
6663 private def createOutputOperationProgressBar (batch : BatchUIData ): Seq [Node ] = {
67- SparkUIUtils .makeProgressBar(
68- started = batch.numActiveOutputOp,
69- completed = batch.numCompletedOutputOp,
70- failed = batch.numFailedOutputOp,
71- skipped = 0 ,
72- reasonToNumKilled = Map .empty,
73- total = batch.outputOperations.size)
64+ <td class =" progress-cell" >
65+ {
66+ SparkUIUtils .makeProgressBar(
67+ started = batch.numActiveOutputOp,
68+ completed = batch.numCompletedOutputOp,
69+ failed = batch.numFailedOutputOp,
70+ skipped = 0 ,
71+ reasonToNumKilled = Map .empty,
72+ total = batch.outputOperations.size)
73+ }
74+ </td >
7475 }
7576
7677 override def tableId : String = s " $tableTag-table "
@@ -98,19 +99,17 @@ private[ui] class StreamingPagedTable(
9899 new StreamingDataSource (batches, pageSize, sortColumn, desc)
99100
100101 override def headers : Seq [Node ] = {
101- // tuple containing tooltips for header fields
102- val tooltips = (" Time taken by Streaming scheduler to submit jobs of a batch" ,
103- " Time taken to process all jobs of a batch" , " Total time taken to handle a batch" )
104102 // headers, sortable and tooltips
105103 val headersAndCssClasses : Seq [(String , Boolean , Option [String ])] = {
106104 Seq (
107105 (" Batch Time" , true , None ),
108106 (" Records" , true , None ),
109- (" Scheduling Delay" , true , Some (tooltips._1)),
110- (" Processing Time" , true , Some (tooltips._2))) ++ {
111- if (isCompletedTable) {
107+ (" Scheduling Delay" , true , Some (" Time taken by Streaming scheduler to submit jobs " +
108+ " of a batch" )),
109+ (" Processing Time" , true , Some (" Time taken to process all jobs of a batch" ))) ++ {
110+ if (tableTag.equals(" completedBatches" )) {
112111 Seq (
113- (" Total Delay" , true , Some (tooltips._3 )),
112+ (" Total Delay" , true , Some (" Total time taken to handle a batch " )),
114113 (" Output Ops: Succeeded/Total" , false , None ))
115114 } else {
116115 Seq (
@@ -144,26 +143,26 @@ private[ui] class StreamingPagedTable(
144143 val formattedTotalDelay = totalDelay.map(SparkUIUtils .formatDuration).getOrElse(" -" )
145144
146145 <tr >
147- <td id = {batchTimeId} isFailed = {batch.isFailed.toString}>
146+ <td id = {batchTimeId} isFailed = {batch.isFailed.toString}>
148147 <a href ={s " batch?id= $batchTime" }>
149148 {formattedBatchTime}
150149 </a >
151150 </td >
152- <td > {numRecords.toString} Records </td >
151+ <td > {numRecords.toString} records </td >
153152 <td > {formattedSchedulingDelay} </td >
154153 <td > {formattedProcessingTime} </td >
155154 {
156- if (isCompletedTable ) {
157- <td > {formattedTotalDelay} </td >
158- < td class = " progress-cell " > { createOutputOperationProgressBar(batch)} </ td > ++ {
155+ if (tableTag.equals( " completedBatches " ) ) {
156+ <td > {formattedTotalDelay} </td > ++
157+ createOutputOperationProgressBar(batch) ++ {
159158 if (firstFailureReason.nonEmpty) {
160159 getFirstFailureTableCell(batch)
161160 } else {
162161 Nil
163162 }
164163 }
165- } else if (isRunningTable ) {
166- < td class = " progress-cell " > { createOutputOperationProgressBar(batch)} </ td >
164+ } else if (tableTag.equals( " runningBatches " ) ) {
165+ createOutputOperationProgressBar(batch) ++
167166 <td > processing </td > ++ {
168167 if (firstFailureReason.nonEmpty) {
169168 getFirstFailureTableCell(batch)
@@ -172,7 +171,7 @@ private[ui] class StreamingPagedTable(
172171 }
173172 }
174173 } else {
175- < td class = " progress-cell " > { createOutputOperationProgressBar(batch)} </ td >
174+ createOutputOperationProgressBar(batch) ++
176175 <td > queued </td > ++ {
177176 if (firstFailureReason.nonEmpty) {
178177 // Waiting batches have not run yet, so must have no failure reasons.
0 commit comments