Skip to content

Commit 8a2351b

Browse files
committed
Add help tooltip to Spark Jobs page.
1 parent b7bf30e commit 8a2351b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

core/src/main/scala/org/apache/spark/ui/UIUtils.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ private[spark] object UIUtils extends Logging {
169169
title: String,
170170
content: => Seq[Node],
171171
activeTab: SparkUITab,
172-
refreshInterval: Option[Int] = None): Seq[Node] = {
172+
refreshInterval: Option[Int] = None,
173+
helpText: Option[String] = None): Seq[Node] = {
173174

174175
val appName = activeTab.appName
175176
val shortAppName = if (appName.length < 36) appName else appName.take(32) + "..."
@@ -178,6 +179,9 @@ private[spark] object UIUtils extends Logging {
178179
<a href={prependBaseUri(activeTab.basePath, "/" + tab.prefix)}>{tab.name}</a>
179180
</li>
180181
}
182+
val helpButton: Seq[Node] = helpText.map { helpText =>
183+
<a data-toggle="tooltip" data-placement="bottom" title={helpText}>(?)</a>
184+
}.getOrElse(Seq.empty)
181185

182186
<html>
183187
<head>
@@ -201,6 +205,7 @@ private[spark] object UIUtils extends Logging {
201205
<div class="span12">
202206
<h3 style="vertical-align: bottom; display: inline-block;">
203207
{title}
208+
{helpButton}
204209
</h3>
205210
</div>
206211
</div>

core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
147147
<h4 id="completed">Completed Jobs ({completedJobs.size})</h4> ++ completedJobsTable ++
148148
<h4 id ="failed">Failed Jobs ({failedJobs.size})</h4> ++ failedJobsTable
149149

150-
UIUtils.headerSparkPage("Spark Jobs", content, parent)
150+
val helpText = """A job is triggered by a action, like "count()" or "saveAsTextFile()".""" +
151+
" Click on a job's title to see information about the stages of tasks associated with" +
152+
" the job."
153+
154+
UIUtils.headerSparkPage("Spark Jobs", content, parent, helpText = Some(helpText))
151155
}
152156
}
153157
}

0 commit comments

Comments
 (0)