Enforcing correct sort order for formatted strings

This commit is contained in:
Patrick Wendell 2013-07-05 17:21:01 -07:00
parent 39e2325675
commit 84b7fc54e6
4 changed files with 19 additions and 7 deletions

View file

@ -90,8 +90,10 @@ private[spark] class IndexPage(parent: MasterWebUI) {
<td>{worker.host}:{worker.port}</td>
<td>{worker.state}</td>
<td>{worker.cores} ({worker.coresUsed} Used)</td>
<td>{Utils.memoryMegabytesToString(worker.memory)}
({Utils.memoryMegabytesToString(worker.memoryUsed)} Used)</td>
<td sorttable_customkey={"%s.%s".format(worker.memory, worker.memoryUsed)}>
{Utils.memoryMegabytesToString(worker.memory)}
({Utils.memoryMegabytesToString(worker.memoryUsed)} Used)
</td>
</tr>
}
@ -105,7 +107,9 @@ private[spark] class IndexPage(parent: MasterWebUI) {
<td>
{app.coresGranted}
</td>
<td>{Utils.memoryMegabytesToString(app.desc.memoryPerSlave)}</td>
<td sorttable_customkey={app.desc.memoryPerSlave.toString}>
{Utils.memoryMegabytesToString(app.desc.memoryPerSlave)}
</td>
<td>{DeployWebUI.formatDate(app.submitDate)}</td>
<td>{app.desc.user}</td>
<td>{app.state.toString}</td>

View file

@ -77,7 +77,9 @@ private[spark] class IndexPage(parent: WorkerWebUI) {
<tr>
<td>{executor.execId}</td>
<td>{executor.cores}</td>
<td>{Utils.memoryMegabytesToString(executor.memory)}</td>
<td sorttable_customkey={executor.memory.toString}>
{Utils.memoryMegabytesToString(executor.memory)}
</td>
<td>
<ul class="unstyled">
<li><strong>ID:</strong> {executor.appId}</li>

View file

@ -93,7 +93,9 @@ private[spark] class StagePage(parent: JobProgressUI) {
val (info, metrics, exception) = taskData
<tr>
<td>{info.taskId}</td>
<td>{Option(metrics).map{m => parent.formatDuration(m.executorRunTime)}.getOrElse("")}</td>
<td sorttable_customkey={Option(metrics).map{m => m.executorRunTime.toString}.getOrElse("1")}>
{Option(metrics).map{m => parent.formatDuration(m.executorRunTime)}.getOrElse("")}
</td>
<td>{info.taskLocality}</td>
<td>{info.hostPort}</td>
<td>{dateFmt.format(new Date(info.launchTime))}</td>

View file

@ -81,8 +81,12 @@ private[spark] class RDDPage(parent: BlockManagerUI) {
<td>
{block.storageLevel.description}
</td>
<td>{Utils.memoryBytesToString(block.memSize)}</td>
<td>{Utils.memoryBytesToString(block.diskSize)}</td>
<td sorttable_customkey={block.memSize.toString}>
{Utils.memoryBytesToString(block.memSize)}
</td>
<td sorttable_customkey={block.diskSize.toString}>
{Utils.memoryBytesToString(block.diskSize)}
</td>
</tr>
}