Repository: spark
Updated Branches:
  refs/heads/branch-2.3 7edfdfcec -> 8ccc47881


[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]>
(cherry picked from commit 3ce2e008ec1bf70adc5a4b356e09a469e94af803)
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/8ccc4788
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/8ccc4788
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/8ccc4788

Branch: refs/heads/branch-2.3
Commit: 8ccc4788154080e8508818c3a612c364edfeef59
Parents: 7edfdfc
Author: Shahid <[email protected]>
Authored: Mon Sep 24 14:17:42 2018 -0700
Committer: Marcelo Vanzin <[email protected]>
Committed: Mon Sep 24 14:18:20 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/8ccc4788/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 7ab4336..365a974 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>
@@ -677,7 +678,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) {
@@ -1043,9 +1044,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