Skip to content

Commit e62820c

Browse files
jbonofresrowen
authored andcommitted
[SPARK-6541] Sort executors by ID (numeric)
"Force" the executor ID sort with Int. Author: Jean-Baptiste Onofré <[email protected]> Closes #9165 from jbonofre/SPARK-6541.
1 parent b8f4379 commit e62820c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

core/src/main/resources/org/apache/spark/ui/static/sorttable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ sorttable = {
8989
// make it clickable to sort
9090
headrow[i].sorttable_columnindex = i;
9191
headrow[i].sorttable_tbody = table.tBodies[0];
92-
dean_addEvent(headrow[i],"click", function(e) {
92+
dean_addEvent(headrow[i],"click", sorttable.innerSortFunction = function(e) {
9393

9494
if (this.className.search(/\bsorttable_sorted\b/) != -1) {
9595
// if we're already sorted by this column, just

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.spark.ui.jobs
1919

2020
import scala.collection.mutable
21-
import scala.xml.Node
21+
import scala.xml.{Unparsed, Node}
2222

2323
import org.apache.spark.ui.{ToolTips, UIUtils}
2424
import org.apache.spark.ui.jobs.UIData.StageUIData
@@ -52,7 +52,7 @@ private[ui] class ExecutorTable(stageId: Int, stageAttemptId: Int, parent: Stage
5252

5353
<table class={UIUtils.TABLE_CLASS_STRIPED_SORTABLE}>
5454
<thead>
55-
<th>Executor ID</th>
55+
<th id="executorid">Executor ID</th>
5656
<th>Address</th>
5757
<th>Task Time</th>
5858
<th>Total Tasks</th>
@@ -89,6 +89,15 @@ private[ui] class ExecutorTable(stageId: Int, stageAttemptId: Int, parent: Stage
8989
{createExecutorTable()}
9090
</tbody>
9191
</table>
92+
<script>
93+
{Unparsed {
94+
"""
95+
| window.onload = function() {
96+
| sorttable.innerSortFunction.apply(document.getElementById('executorid'), [])
97+
| };
98+
""".stripMargin
99+
}}
100+
</script>
92101
}
93102

94103
private def createExecutorTable() : Seq[Node] = {

0 commit comments

Comments
 (0)