From 51c458a5c4562c54ff147824816f7b44c4b9b8f6 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Thu, 16 Apr 2015 10:04:09 -0500 Subject: [PATCH] MAPREDUCE-6300. Task list sort by task id broken. Contributed by Siqi Li. (cherry picked from commit 1fa8075794894b3e0053d251788277fb88e85533) --- hadoop-mapreduce-project/CHANGES.txt | 2 ++ .../org/apache/hadoop/mapreduce/v2/app/webapp/TasksPage.java | 2 +- .../org/apache/hadoop/mapreduce/v2/hs/webapp/HsTasksPage.java | 2 +- .../src/main/resources/webapps/static/yarn.dt.plugins.js | 3 +++ .../applicationhistoryservice/webapp/AppAttemptPage.java | 4 ++-- .../yarn/server/applicationhistoryservice/webapp/AppPage.java | 2 +- .../org/apache/hadoop/yarn/server/webapp/AppAttemptBlock.java | 2 -- .../java/org/apache/hadoop/yarn/server/webapp/AppBlock.java | 2 -- .../java/org/apache/hadoop/yarn/server/webapp/AppsBlock.java | 1 - .../server/resourcemanager/webapp/FairSchedulerAppsBlock.java | 1 - .../hadoop/yarn/server/resourcemanager/webapp/RMAppBlock.java | 2 -- .../yarn/server/resourcemanager/webapp/RMAppsBlock.java | 1 - 12 files changed, 10 insertions(+), 14 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 78ea4ca9490..d52527c9bb9 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -101,6 +101,8 @@ Release 2.7.1 - UNRELEASED BUG FIXES + MAPREDUCE-6300. Task list sort by task id broken. (Siqi Li via aajisaka) + Release 2.7.0 - UNRELEASED INCOMPATIBLE CHANGES 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 0212ae4f741..96485279db2 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 @@ -43,7 +43,7 @@ public class TasksPage extends AppView { .append(", bProcessing: true") .append("\n, aoColumnDefs: [\n") - .append("{'sType':'numeric', 'aTargets': [0]") + .append("{'sType':'string', 'aTargets': [0]") .append(", 'mRender': parseHadoopID }") .append("\n, {'sType':'numeric', bSearchable:false, 'aTargets': [1]") 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 4e2b6878df0..2619dffdd04 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 @@ -76,7 +76,7 @@ public class HsTasksPage extends HsView { .append(", bProcessing: true") .append("\n, aoColumnDefs: [\n") - .append("{'sType':'numeric', 'aTargets': [ 0 ]") + .append("{'sType':'string', 'aTargets': [ 0 ]") .append(", 'mRender': parseHadoopID }") .append(", {'sType':'numeric', 'aTargets': [ 4") diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js index 7b069df4837..c9416fd005e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js @@ -139,6 +139,9 @@ function renderHadoopElapsedTime(data, type, full) { return data; } +//JSON array element is formatted like +//"application_1360183373897_0001" +//this function removes tag and return a string value for sorting function parseHadoopID(data, type, full) { if (type === 'display') { return data; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppAttemptPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppAttemptPage.java index 540f6e6bde9..c7fe3189558 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppAttemptPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppAttemptPage.java @@ -53,8 +53,8 @@ public class AppAttemptPage extends AHSView { protected String getContainersTableColumnDefs() { StringBuilder sb = new StringBuilder(); - return sb.append("[\n").append("{'sType':'numeric', 'aTargets': [0]") + return sb.append("[\n").append("{'sType':'string', 'aTargets': [0]") .append(", 'mRender': parseHadoopID }]").toString(); } -} \ No newline at end of file +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppPage.java index cf92c1db9af..50dcd9665ee 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppPage.java @@ -55,7 +55,7 @@ public class AppPage extends AHSView { protected String getAttemptsTableColumnDefs() { StringBuilder sb = new StringBuilder(); - return sb.append("[\n").append("{'sType':'numeric', 'aTargets': [0]") + return sb.append("[\n").append("{'sType':'string', 'aTargets': [0]") .append(", 'mRender': parseHadoopID }") .append("\n, {'sType':'numeric', 'aTargets': [1]") diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppAttemptBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppAttemptBlock.java index 8695c6cc6f3..d320f4adc92 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppAttemptBlock.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppAttemptBlock.java @@ -158,8 +158,6 @@ public class AppAttemptBlock extends HtmlBlock { StringBuilder containersTableData = new StringBuilder("[\n"); for (ContainerReport containerReport : containers) { ContainerInfo container = new ContainerInfo(containerReport); - // ConatinerID numerical value parsed by parseHadoopID in - // yarn.dt.plugins.js containersTableData .append("[\"") .append(appInfo.getAppId()).append("\",\"") diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppBlock.java index 494207994f1..3779b91588e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppBlock.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppBlock.java @@ -172,8 +172,6 @@ public class RMAppBlock extends AppBlock{ blacklistedNodesCount = String.valueOf(nodes.size()); } - // AppAttemptID numerical value parsed by parseHadoopID in - // yarn.dt.plugins.js attemptsTableData .append("[\"