Skip to content

Commit

Permalink
[SPARK-29460][WEBUI] Add tooltip for Jobs page
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Adding tooltip for jobs tab column - Job Id (Job Group), Description ,Submitted, Duration, Stages, Tasks

Before:
![Screenshot from 2019-11-04 11-31-02](https://user-images.githubusercontent.com/51401130/68102467-e8a54300-fef8-11e9-9f9e-48dd1b393ac8.png)

After:
![Screenshot from 2019-11-04 11-30-53](https://user-images.githubusercontent.com/51401130/68102478-f3f86e80-fef8-11e9-921a-357678229cb4.png)

### Why are the changes needed?
Jobs tab do not have any tooltip for the columns, Some page provide tooltip , inorder to resolve the inconsistency and for better user experience.

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
Manual

Closes #26384 from PavithraRamachandran/jobTab_tooltip.

Authored-by: Pavithra Ramachandran <pavi.rams@gmail.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
  • Loading branch information
PavithraRamachandran authored and srowen committed Dec 11, 2019
1 parent 82418b4 commit d46c03c
Showing 1 changed file with 43 additions and 12 deletions.
55 changes: 43 additions & 12 deletions core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala
Expand Up @@ -541,20 +541,23 @@ private[ui] class JobPagedTable(

override def headers: Seq[Node] = {
// Information for each header: title, cssClass, and sortable
val jobHeadersAndCssClasses: Seq[(String, String, Boolean)] =
val jobHeadersAndCssClasses: Seq[(String, String, Boolean, Option[String])] =
Seq(
(jobIdTitle, "", true),
("Description", "", true), ("Submitted", "", true), ("Duration", "", true),
("Stages: Succeeded/Total", "", false),
("Tasks (for all stages): Succeeded/Total", "", false)
(jobIdTitle, "", true, None),
("Description", "", true, None),
("Submitted", "", true, None),
("Duration", "", true, Some("Elapsed time since the job was submitted " +
"until execution completion of all its stages.")),
("Stages: Succeeded/Total", "", false, None),
("Tasks (for all stages): Succeeded/Total", "", false, None)
)

if (!jobHeadersAndCssClasses.filter(_._3).map(_._1).contains(sortColumn)) {
throw new IllegalArgumentException(s"Unknown column: $sortColumn")
}

val headerRow: Seq[Node] = {
jobHeadersAndCssClasses.map { case (header, cssClass, sortable) =>
jobHeadersAndCssClasses.map { case (header, cssClass, sortable, tooltip) =>
if (header == sortColumn) {
val headerLink = Unparsed(
parameterPath +
Expand All @@ -566,9 +569,17 @@ private[ui] class JobPagedTable(

<th class={cssClass}>
<a href={headerLink}>
{header}<span>
&nbsp;{Unparsed(arrow)}
</span>
{
if (tooltip.nonEmpty) {
<span data-toggle="tooltip" data-placement="top" title={tooltip.get}>
{header}&nbsp;{Unparsed(arrow)}
</span>
} else {
<span>
{header}&nbsp;{Unparsed(arrow)}
</span>
}
}
</a>
</th>
} else {
Expand All @@ -581,12 +592,32 @@ private[ui] class JobPagedTable(

<th class={cssClass}>
<a href={headerLink}>
{header}
</a>
{
if (tooltip.nonEmpty) {
<span data-toggle="tooltip" data-placement="top" title={tooltip.get}>
{header}
</span>
} else {
<span>
{header}
</span>
}
}
</a>
</th>
} else {
<th class={cssClass}>
{header}
{
if (tooltip.nonEmpty) {
<span data-toggle="tooltip" data-placement="top" title={tooltip.get}>
{header}
</span>
} else {
<span>
{header}
</span>
}
}
</th>
}
}
Expand Down

0 comments on commit d46c03c

Please sign in to comment.