Repository: spark
Updated Branches:
  refs/heads/master bb49661e1 -> 3ce2e008e


[SPARK-25502][CORE][WEBUI] Empty Page when page number exceeds the reatinedTask 
size.

## What changes were proposed in this pull request?
Test steps :
1)  bin/spark-shell --conf spark.ui.retainedTasks=200
```
val rdd = sc.parallelize(1 to 1000, 1000)
rdd.count
```

Stage tab in the UI will display 10 pages with 100 tasks per page. But number 
of retained tasks is only 200. So, from the 3rd page onwards will display 
nothing.
 We have to calculate total pages based on the number of tasks need display in 
the UI.

**Before fix:**
![empty_4](https://user-images.githubusercontent.com/23054875/45918251-b1650580-bea1-11e8-90d3-7e0d491981a2.jpg)

**After fix:**
![empty_3](https://user-images.githubusercontent.com/23054875/45918257-c2ae1200-bea1-11e8-960f-dfbdb4a90ae7.jpg)

## How was this patch tested?

Manually tested

Closes #22526 from shahidki31/SPARK-25502.

Authored-by: Shahid <[email protected]>
Signed-off-by: Marcelo Vanzin <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/3ce2e008
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/3ce2e008
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/3ce2e008

Branch: refs/heads/master
Commit: 3ce2e008ec1bf70adc5a4b356e09a469e94af803
Parents: bb49661e1
Author: Shahid <[email protected]>
Authored: Mon Sep 24 14:17:42 2018 -0700
Committer: Marcelo Vanzin <[email protected]>
Committed: Mon Sep 24 14:17:42 2018 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/ui/jobs/StagePage.scala   | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/3ce2e008/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala 
b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
index 55eb989..fd6a298 100644
--- a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
+++ b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
@@ -117,7 +117,8 @@ private[ui] class StagePage(parent: StagesTab, store: 
AppStatusStore) extends We
 
     val localitySummary = store.localitySummary(stageData.stageId, 
stageData.attemptId)
 
-    val totalTasks = taskCount(stageData)
+    val totalTasks = stageData.numActiveTasks + stageData.numCompleteTasks +
+      stageData.numFailedTasks + stageData.numKilledTasks
     if (totalTasks == 0) {
       val content =
         <div>
@@ -685,7 +686,7 @@ private[ui] class TaskDataSource(
 
   private var _tasksToShow: Seq[TaskData] = null
 
-  override def dataSize: Int = taskCount(stage)
+  override def dataSize: Int = store.taskCount(stage.stageId, 
stage.attemptId).toInt
 
   override def sliceData(from: Int, to: Int): Seq[TaskData] = {
     if (_tasksToShow == null) {
@@ -1051,9 +1052,4 @@ private[ui] object ApiHelper {
     (stage.map(_.name).getOrElse(""), 
stage.flatMap(_.description).getOrElse(job.name))
   }
 
-  def taskCount(stageData: StageData): Int = {
-    stageData.numActiveTasks + stageData.numCompleteTasks + 
stageData.numFailedTasks +
-      stageData.numKilledTasks
-  }
-
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to