diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 32a2013bcd4..076004cd7d6 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -116,6 +116,9 @@ Release 0.23.1 - Unreleased 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 BUG FIXES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppView.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppView.java index 613bda5097d..e4fd7f43311 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppView.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AppView.java @@ -51,6 +51,8 @@ public class AppView extends TwoColumnLayout { private String jobsTableInit() { return tableInit(). + // Sort by id upon page load + append(", aaSorting: [[0, 'asc']]"). append(",aoColumns:[{sType:'title-numeric'},"). append("null,null,{sType:'title-numeric', bSearchable:false},null,"). append("null,{sType:'title-numeric',bSearchable:false}, null, null]}"). diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java index 5acc77053fc..c5f581ac463 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java @@ -119,6 +119,9 @@ public class TaskPage extends AppView { } private String attemptsTableInit() { - return tableInit().append("}").toString(); + return tableInit(). + // Sort by id upon page load + append(", aaSorting: [[0, 'asc']]"). + append("}").toString(); } } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TasksPage.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TasksPage.java index 607f92df591..3cdac512a3c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TasksPage.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TasksPage.java @@ -38,6 +38,8 @@ public class TasksPage extends AppView { private String tasksTableInit() { return tableInit(). + // Sort by id upon page load + append(", aaSorting: [[0, 'asc']]"). append(",aoColumns:[{sType:'title-numeric'},{sType:'title-numeric',"). append("bSearchable:false},null,{sType:'title-numeric'},"). append("{sType:'title-numeric'},{sType:'title-numeric'}]}").toString(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTaskPage.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTaskPage.java index ce7d2b51ec2..5927a9f5304 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTaskPage.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTaskPage.java @@ -296,8 +296,12 @@ public class HsTaskPage extends HsView { } else { //MAP 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(); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTasksPage.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTasksPage.java index d7956fda5ed..13a6aed3732 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTasksPage.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTasksPage.java @@ -74,8 +74,12 @@ public class HsTasksPage extends HsView { } else { //MAP 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(); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java index ddb904da3d5..630c541fc97 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsView.java @@ -84,11 +84,17 @@ public class HsView extends TwoColumnLayout { */ private String jobsTableInit() { return tableInit(). - append(",aoColumnDefs:["). - append("{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 6 ] }"). - append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 7 ] }"). + // Sort by id upon page load + append(", aaSorting: [[2, 'asc']]"). + append(", aoColumnDefs:["). + // Maps Total + append("{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 7 ] }"). + // Maps Completed append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 8 ] }"). + // Reduces Total append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 9 ] }"). + // Reduces Completed + append(",{'sType':'numeric', 'bSearchable': false, 'aTargets': [ 10 ] }"). append("]}"). toString(); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/JQueryUI.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/JQueryUI.java index 1c61a8571c5..a007f4c28d4 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/JQueryUI.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/JQueryUI.java @@ -224,7 +224,7 @@ public class JQueryUI extends HtmlBlock { } public static StringBuilder tableInit() { - return new StringBuilder("{bJQueryUI:true, aaSorting:[], "). + return new StringBuilder("{bJQueryUI:true, "). append("sPaginationType: 'full_numbers', iDisplayLength:20, "). append("aLengthMenu:[20, 40, 60, 80, 100]"); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java index 49b75373d78..8d8f09c0386 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/AllApplicationsPage.java @@ -51,6 +51,8 @@ public class AllApplicationsPage extends NMView { private String appsTableInit() { return tableInit(). + // Sort by id upon page load + append(", aaSorting: [[0, 'asc']]"). // applicationid, applicationstate append(", aoColumns:[null, null]} ").toString(); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RmView.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RmView.java index 7c175d1317c..131952eb04b 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RmView.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RmView.java @@ -61,6 +61,10 @@ public class RmView extends TwoColumnLayout { StringBuilder init = tableInit(). append(", aoColumns:[{sType:'title-numeric'}, null, null, 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"); int rowLimit = rows.isEmpty() ? MAX_DISPLAY_ROWS : Integer.parseInt(rows); if (list.apps.size() < rowLimit) {