MAPREDUCE-3413. RM web ui applications not sorted in any order by default. (Jonathan Eagles via mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1206926 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mahadev Konar 2011-11-27 23:56:46 +00:00
parent 7f0f8cb7b0
commit cc4a468113
10 changed files with 39 additions and 9 deletions

View File

@ -116,6 +116,9 @@ Release 0.23.1 - Unreleased
MAPREDUCE-3238. Small cleanup in SchedulerApp. (Todd Lipcon via mahadev) MAPREDUCE-3238. Small cleanup in SchedulerApp. (Todd Lipcon via mahadev)
MAPREDUCE-3413. RM web ui applications not sorted in any order by default.
(Jonathan Eagles via mahadev)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -51,6 +51,8 @@ public class AppView extends TwoColumnLayout {
private String jobsTableInit() { private String jobsTableInit() {
return tableInit(). return tableInit().
// Sort by id upon page load
append(", aaSorting: [[0, 'asc']]").
append(",aoColumns:[{sType:'title-numeric'},"). append(",aoColumns:[{sType:'title-numeric'},").
append("null,null,{sType:'title-numeric', bSearchable:false},null,"). append("null,null,{sType:'title-numeric', bSearchable:false},null,").
append("null,{sType:'title-numeric',bSearchable:false}, null, null]}"). append("null,{sType:'title-numeric',bSearchable:false}, null, null]}").

View File

@ -119,6 +119,9 @@ public class TaskPage extends AppView {
} }
private String attemptsTableInit() { private String attemptsTableInit() {
return tableInit().append("}").toString(); return tableInit().
// Sort by id upon page load
append(", aaSorting: [[0, 'asc']]").
append("}").toString();
} }
} }

View File

@ -38,6 +38,8 @@ public class TasksPage extends AppView {
private String tasksTableInit() { private String tasksTableInit() {
return tableInit(). return tableInit().
// Sort by id upon page load
append(", aaSorting: [[0, 'asc']]").
append(",aoColumns:[{sType:'title-numeric'},{sType:'title-numeric',"). append(",aoColumns:[{sType:'title-numeric'},{sType:'title-numeric',").
append("bSearchable:false},null,{sType:'title-numeric'},"). append("bSearchable:false},null,{sType:'title-numeric'},").
append("{sType:'title-numeric'},{sType:'title-numeric'}]}").toString(); append("{sType:'title-numeric'},{sType:'title-numeric'}]}").toString();

View File

@ -296,8 +296,12 @@ public class HsTaskPage extends HsView {
} else { //MAP } else { //MAP
b.append(", 5"); b.append(", 5");
} }
b.append(" ] }"); b.append(" ] }]");
b.append("]}");
// Sort by id upon page load
b.append(", aaSorting: [[0, 'asc']]");
b.append("}");
return b.toString(); return b.toString();
} }

View File

@ -74,8 +74,12 @@ public class HsTasksPage extends HsView {
} else { //MAP } else { //MAP
b.append(", 7"); b.append(", 7");
} }
b.append(" ] }"); b.append(" ] }]");
b.append("]}");
// Sort by id upon page load
b.append(", aaSorting: [[0, 'asc']]");
b.append("}");
return b.toString(); return b.toString();
} }

View File

@ -84,11 +84,17 @@ public class HsView extends TwoColumnLayout {
*/ */
private String jobsTableInit() { private String jobsTableInit() {
return tableInit(). return tableInit().
append(",aoColumnDefs:["). // Sort by id upon page load
append("{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 6 ] }"). append(", aaSorting: [[2, 'asc']]").
append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 7 ] }"). append(", aoColumnDefs:[").
// Maps Total
append("{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 7 ] }").
// Maps Completed
append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 8 ] }"). append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 8 ] }").
// Reduces Total
append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 9 ] }"). append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 9 ] }").
// Reduces Completed
append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 10 ] }").
append("]}"). append("]}").
toString(); toString();
} }

View File

@ -224,7 +224,7 @@ public class JQueryUI extends HtmlBlock {
} }
public static StringBuilder tableInit() { public static StringBuilder tableInit() {
return new StringBuilder("{bJQueryUI:true, aaSorting:[], "). return new StringBuilder("{bJQueryUI:true, ").
append("sPaginationType: 'full_numbers', iDisplayLength:20, "). append("sPaginationType: 'full_numbers', iDisplayLength:20, ").
append("aLengthMenu:[20, 40, 60, 80, 100]"); append("aLengthMenu:[20, 40, 60, 80, 100]");
} }

View File

@ -51,6 +51,8 @@ public class AllApplicationsPage extends NMView {
private String appsTableInit() { private String appsTableInit() {
return tableInit(). return tableInit().
// Sort by id upon page load
append(", aaSorting: [[0, 'asc']]").
// applicationid, applicationstate // applicationid, applicationstate
append(", aoColumns:[null, null]} ").toString(); append(", aoColumns:[null, null]} ").toString();
} }

View File

@ -61,6 +61,10 @@ public class RmView extends TwoColumnLayout {
StringBuilder init = tableInit(). StringBuilder init = tableInit().
append(", aoColumns:[{sType:'title-numeric'}, null, null, null, null,"). append(", aoColumns:[{sType:'title-numeric'}, null, null, null, null,").
append("null,{sType:'title-numeric', bSearchable:false}, null, null]"); append("null,{sType:'title-numeric', bSearchable:false}, null, null]");
// Sort by id upon page load
init.append(", aaSorting: [[0, 'asc']]");
String rows = $("rowlimit"); String rows = $("rowlimit");
int rowLimit = rows.isEmpty() ? MAX_DISPLAY_ROWS : Integer.parseInt(rows); int rowLimit = rows.isEmpty() ? MAX_DISPLAY_ROWS : Integer.parseInt(rows);
if (list.apps.size() < rowLimit) { if (list.apps.size() < rowLimit) {