You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by pw...@apache.org on 2014/07/27 21:35:28 UTC

git commit: [SPARK-2705][CORE] Fixed stage description in stage info page

Repository: spark
Updated Branches:
  refs/heads/master 985705301 -> 2bbf23537


[SPARK-2705][CORE] Fixed stage description in stage info page

Stage description should be a `String`, but was changed to an `Option[String]` by mistake:

![stage-desc-small](https://cloud.githubusercontent.com/assets/230655/3655611/f6d0b0f6-117b-11e4-83ed-71000dcd5009.png)

Author: Cheng Lian <li...@gmail.com>

Closes #1524 from liancheng/fix-stage-desc and squashes the following commits:

3c69327 [Cheng Lian] Fixed stage description object type in Web UI stage table


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

Branch: refs/heads/master
Commit: 2bbf235376f40a4b95d7e6e42e1bed893c124ecb
Parents: 9857053
Author: Cheng Lian <li...@gmail.com>
Authored: Sun Jul 27 12:35:21 2014 -0700
Committer: Patrick Wendell <pw...@gmail.com>
Committed: Sun Jul 27 12:35:21 2014 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/ui/jobs/StageTable.scala   | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/2bbf2353/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala b/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
index f8b308c..3dcfaf7 100644
--- a/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
+++ b/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
@@ -119,14 +119,14 @@ private[ui] class StageTableBase(
       </div>
     }
 
-    val stageDataOption = listener.stageIdToData.get(s.stageId)
-    // Too many nested map/flatMaps with options are just annoying to read. Do this imperatively.
-    if (stageDataOption.isDefined && stageDataOption.get.description.isDefined) {
-      val desc = stageDataOption.get.description
-      <div><em>{desc}</em></div><div>{killLink} {nameLink} {details}</div>
-    } else {
-      <div>{killLink} {nameLink} {details}</div>
+    val stageDesc = for {
+      stageData <- listener.stageIdToData.get(s.stageId)
+      desc <- stageData.description
+    } yield {
+      <div><em>{desc}</em></div>
     }
+
+    <div>{stageDesc.getOrElse("")} {killLink} {nameLink} {details}</div>
   }
 
   protected def stageRow(s: StageInfo): Seq[Node] = {