Skip to content

Commit

Permalink
[SPARK-6541] Sort executors by ID (numeric)
Browse files Browse the repository at this point in the history
"Force" the executor ID sort with Int.

Author: Jean-Baptiste Onofré <[email protected]>

Closes #9165 from jbonofre/SPARK-6541.

(cherry picked from commit e62820c)
Signed-off-by: Sean Owen <[email protected]>
  • Loading branch information
jbonofre authored and srowen committed Nov 18, 2015
1 parent 5da7d41 commit 04938d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ sorttable = {
// make it clickable to sort
headrow[i].sorttable_columnindex = i;
headrow[i].sorttable_tbody = table.tBodies[0];
dean_addEvent(headrow[i],"click", function(e) {
dean_addEvent(headrow[i],"click", sorttable.innerSortFunction = function(e) {

if (this.className.search(/\bsorttable_sorted\b/) != -1) {
// if we're already sorted by this column, just
Expand Down
13 changes: 11 additions & 2 deletions core/src/main/scala/org/apache/spark/ui/jobs/ExecutorTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.spark.ui.jobs

import scala.collection.mutable
import scala.xml.Node
import scala.xml.{Unparsed, Node}

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

<table class={UIUtils.TABLE_CLASS_STRIPED_SORTABLE}>
<thead>
<th>Executor ID</th>
<th id="executorid">Executor ID</th>
<th>Address</th>
<th>Task Time</th>
<th>Total Tasks</th>
Expand Down Expand Up @@ -89,6 +89,15 @@ private[ui] class ExecutorTable(stageId: Int, stageAttemptId: Int, parent: Stage
{createExecutorTable()}
</tbody>
</table>
<script>
{Unparsed {
"""
| window.onload = function() {
| sorttable.innerSortFunction.apply(document.getElementById('executorid'), [])
| };
""".stripMargin
}}
</script>
}

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

0 comments on commit 04938d9

Please sign in to comment.