From f489339c7532c3bdf1d95a6ed93347e487f05c50 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Thu, 22 Dec 2016 09:43:46 +0000 Subject: [SPARK-18953][CORE][WEB UI] Do now show the link to a dead worker on the master page ## What changes were proposed in this pull request? For a dead worker, we will not be able to see its worker page anyway. This PR removes the links to dead workers from the master page. ## How was this patch tested? Since this is UI change, please do the following steps manually. **1. Start a master and a slave** ``` sbin/start-master.sh sbin/start-slave.sh spark://10.22.16.140:7077 ``` ![1_live_worker_a](https://cloud.githubusercontent.com/assets/9700541/21373572/d7e187d6-c6d4-11e6-9110-f4371d215dec.png) **2. Stop the slave** ``` sbin/stop-slave.sh ``` ![2_dead_worker_a](https://cloud.githubusercontent.com/assets/9700541/21373579/dd9e9704-c6d4-11e6-9047-a22cb0aa83ed.png) **3. Start a slave** ``` sbin/start-slave.sh spark://10.22.16.140:7077 ``` ![3_dead_worder_a_and_live_worker_b](https://cloud.githubusercontent.com/assets/9700541/21373582/e1b207f4-c6d4-11e6-89cb-6d8970175a5e.png) **4. Stop the slave** ``` sbin/stop-slave.sh ``` ![4_dead_worker_a_and_b](https://cloud.githubusercontent.com/assets/9700541/21373584/e5fecb4e-c6d4-11e6-95d3-49defe366946.png) **5. Driver list testing** Do the followings and stop the slave in a minute by `sbin/stop-slave.sh`. ``` sbin/start-master.sh sbin/start-slave.sh spark://10.22.16.140:7077 bin/spark-submit --master=spark://10.22.16.140:7077 --deploy-mode=cluster --class org.apache.spark.examples.SparkPi examples/target/scala-2.11/jars/spark-examples_2.11-2.2.0-SNAPSHOT.jar 10000 ``` ![5_dead_worker_in_driver_list](https://cloud.githubusercontent.com/assets/9700541/21401320/be6cc9fc-c768-11e6-8de7-6512961296a5.png) Author: Dongjoon Hyun Closes #16366 from dongjoon-hyun/SPARK-18953. --- .../apache/spark/deploy/master/ui/MasterPage.scala | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'core/src/main/scala/org') diff --git a/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala b/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala index 3fb860582c..ebbbbd3b71 100644 --- a/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala +++ b/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala @@ -176,8 +176,15 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") { private def workerRow(worker: WorkerInfo): Seq[Node] = { - {worker.id} + { + if (worker.isAlive()) { + + {worker.id} + + } else { + worker.id + } + } {worker.host}:{worker.port} {worker.state} @@ -247,10 +254,13 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") { {driver.id} {killLink} {driver.submitDate} {driver.worker.map(w => - - {w.id.toString} - ).getOrElse("None")} + if (w.isAlive()) { + + {w.id.toString} + + } else { + w.id.toString + }).getOrElse("None")} {driver.state} -- cgit v1.2.3