spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] iRakson commented on a change in pull request #26756: [SPARK-30119][WebUI]Support Pagination for Completed Batch Table in Streaming Tab
Date Fri, 06 Dec 2019 04:22:28 GMT
iRakson commented on a change in pull request #26756: [SPARK-30119][WebUI]Support Pagination
for Completed Batch Table in Streaming Tab
URL: https://github.com/apache/spark/pull/26756#discussion_r354660858
 
 

 ##########
 File path: streaming/src/main/scala/org/apache/spark/streaming/ui/AllBatchesTable.scala
 ##########
 @@ -156,40 +160,232 @@ private[ui] class ActiveBatchTable(
   }
 }
 
-private[ui] class CompletedBatchTable(batches: Seq[BatchUIData], batchInterval: Long)
-  extends BatchTableBase("completed-batches-table", batchInterval) {
+private[ui] class CompletedBatchTableRow(
+    val batchData: BatchUIData,
+    val batchTime: Long,
+    val numRecords: Long,
+    val schedulingDelay: Option[Long],
+    val processingDelay: Option[Long],
+    val totalDelay: Option[Long])
 
-  private val firstFailureReason = getFirstFailureReason(batches)
 
-  override protected def columns: Seq[Node] = super.columns ++ {
-    <th>Total Delay {SparkUIUtils.tooltip("Total time taken to handle a batch", "top")}</th>
-      <th>Output Ops: Succeeded/Total</th> ++ {
-      if (firstFailureReason.nonEmpty) {
-        <th>Error</th>
-      } else {
-        Nil
-      }
-    }
+private[ui] class CompletedBatchPagedTable(
+    request: HttpServletRequest,
+    parent: StreamingTab,
+    batchInterval: Long,
+    data: Seq[BatchUIData],
+    completedBatchTag: String,
+    basePath: String,
+    subPath: String,
+    parameterOtherTable: Iterable[String],
+    pageSize: Int,
+    sortColumn: String,
+    desc: Boolean) extends PagedTable[CompletedBatchTableRow] {
+
+  override val dataSource = new CompletedBatchTableDataSource(data, pageSize, sortColumn,
desc)
+
+  private val parameterPath = s"$basePath/$subPath/?${parameterOtherTable.mkString("&")}"
+
+  private val firstFailureReason = getFirstFailureReason(data)
+
+  override def tableId: String = completedBatchTag
+
+  override def tableCssClass: String =
+    "table table-bordered table-condensed table-striped " +
+      "table-head-clickable table-cell-width-limited"
+
+  override def pageLink(page: Int): String = {
+    val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name())
+    parameterPath +
+      s"&$pageNumberFormField=$page" +
+      s"&$completedBatchTag.sort=$encodedSortColumn" +
+      s"&$completedBatchTag.desc=$desc" +
+      s"&$pageSizeFormField=$pageSize"
   }
 
-  override protected def renderRows: Seq[Node] = {
-    batches.flatMap(batch => <tr>{completedBatchRow(batch)}</tr>)
+  override def pageSizeFormField: String = s"$completedBatchTag.pageSize"
+
+  override def pageNumberFormField: String = s"$completedBatchTag.page"
+
+  override def goButtonFormPath: String = {
+    val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name())
+    s"$parameterPath&$completedBatchTag.sort=$encodedSortColumn&$completedBatchTag.desc=$desc"
   }
 
-  private def completedBatchRow(batch: BatchUIData): Seq[Node] = {
-    val totalDelay = batch.totalDelay
+  override def headers: Seq[Node] = {
+    val completedBatchTableHeaders = Seq("Batch Time", "Records", "Scheduling Delay",
+      "Processing Delay", "Total Delay", "Output Ops: Succeeded/Total")
+
+    val tooltips = Seq(None, None, Some("Time taken by Streaming scheduler to" +
 
 Review comment:
   These tooltips were already there.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message