Repository: spark Updated Branches: refs/heads/master 2e861df96 -> f489339c7
[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 ```  **2. Stop the slave** ``` sbin/stop-slave.sh ```  **3. Start a slave** ``` sbin/start-slave.sh spark://10.22.16.140:7077 ```  **4. Stop the slave** ``` sbin/stop-slave.sh ```  **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 ```  Author: Dongjoon Hyun <dongj...@apache.org> Closes #16366 from dongjoon-hyun/SPARK-18953. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/f489339c Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/f489339c Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/f489339c Branch: refs/heads/master Commit: f489339c7532c3bdf1d95a6ed93347e487f05c50 Parents: 2e861df Author: Dongjoon Hyun <dongj...@apache.org> Authored: Thu Dec 22 09:43:46 2016 +0000 Committer: Sean Owen <so...@cloudera.com> Committed: Thu Dec 22 09:43:46 2016 +0000 ---------------------------------------------------------------------- .../spark/deploy/master/ui/MasterPage.scala | 22 ++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/f489339c/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala ---------------------------------------------------------------------- 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 3fb8605..ebbbbd3 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] = { <tr> <td> - <a href={UIUtils.makeHref(parent.master.reverseProxy, - worker.id, worker.webUiAddress)}>{worker.id}</a> + { + if (worker.isAlive()) { + <a href={UIUtils.makeHref(parent.master.reverseProxy, worker.id, worker.webUiAddress)}> + {worker.id} + </a> + } else { + worker.id + } + } </td> <td>{worker.host}:{worker.port}</td> <td>{worker.state}</td> @@ -247,10 +254,13 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") { <td>{driver.id} {killLink}</td> <td>{driver.submitDate}</td> <td>{driver.worker.map(w => - <a href= - {UIUtils.makeHref(parent.master.reverseProxy, w.id, w.webUiAddress)}> - {w.id.toString}</a> - ).getOrElse("None")} + if (w.isAlive()) { + <a href={UIUtils.makeHref(parent.master.reverseProxy, w.id, w.webUiAddress)}> + {w.id.toString} + </a> + } else { + w.id.toString + }).getOrElse("None")} </td> <td>{driver.state}</td> <td sorttable_customkey={driver.desc.cores.toString}> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org