aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjoon Hyun <dongjoon@apache.org>2016-12-22 09:43:46 +0000
committerSean Owen <sowen@cloudera.com>2016-12-22 09:43:46 +0000
commitf489339c7532c3bdf1d95a6ed93347e487f05c50 (patch)
treeac17edd73a8e8c1c36bc73ca93bbd06d03226339
parent2e861df96eacd821edbbd9883121bff67611074f (diff)
downloadspark-f489339c7532c3bdf1d95a6ed93347e487f05c50.tar.gz
spark-f489339c7532c3bdf1d95a6ed93347e487f05c50.tar.bz2
spark-f489339c7532c3bdf1d95a6ed93347e487f05c50.zip
[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 <dongjoon@apache.org> Closes #16366 from dongjoon-hyun/SPARK-18953.
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala22
1 files changed, 16 insertions, 6 deletions
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] = {
<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}>