MAPREDUCE-6300. Task list sort by task id broken. Contributed by Siqi Li.

(cherry picked from commit 1fa8075794)
This commit is contained in:
Akira Ajisaka 2015-04-16 10:04:09 -05:00
parent 9123f26c73
commit 51c458a5c4
12 changed files with 10 additions and 14 deletions

View File

@ -101,6 +101,8 @@ Release 2.7.1 - UNRELEASED
BUG FIXES BUG FIXES
MAPREDUCE-6300. Task list sort by task id broken. (Siqi Li via aajisaka)
Release 2.7.0 - UNRELEASED Release 2.7.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -43,7 +43,7 @@ public class TasksPage extends AppView {
.append(", bProcessing: true") .append(", bProcessing: true")
.append("\n, aoColumnDefs: [\n") .append("\n, aoColumnDefs: [\n")
.append("{'sType':'numeric', 'aTargets': [0]") .append("{'sType':'string', 'aTargets': [0]")
.append(", 'mRender': parseHadoopID }") .append(", 'mRender': parseHadoopID }")
.append("\n, {'sType':'numeric', bSearchable:false, 'aTargets': [1]") .append("\n, {'sType':'numeric', bSearchable:false, 'aTargets': [1]")

View File

@ -76,7 +76,7 @@ public class HsTasksPage extends HsView {
.append(", bProcessing: true") .append(", bProcessing: true")
.append("\n, aoColumnDefs: [\n") .append("\n, aoColumnDefs: [\n")
.append("{'sType':'numeric', 'aTargets': [ 0 ]") .append("{'sType':'string', 'aTargets': [ 0 ]")
.append(", 'mRender': parseHadoopID }") .append(", 'mRender': parseHadoopID }")
.append(", {'sType':'numeric', 'aTargets': [ 4") .append(", {'sType':'numeric', 'aTargets': [ 4")

View File

@ -139,6 +139,9 @@ function renderHadoopElapsedTime(data, type, full) {
return data; return data;
} }
//JSON array element is formatted like
//"<a href="/proxy/application_1360183373897_0001>">application_1360183373897_0001</a>"
//this function removes <a> tag and return a string value for sorting
function parseHadoopID(data, type, full) { function parseHadoopID(data, type, full) {
if (type === 'display') { if (type === 'display') {
return data; return data;

View File

@ -53,7 +53,7 @@ public class AppAttemptPage extends AHSView {
protected String getContainersTableColumnDefs() { protected String getContainersTableColumnDefs() {
StringBuilder sb = new StringBuilder(); 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(); .append(", 'mRender': parseHadoopID }]").toString();
} }

View File

@ -55,7 +55,7 @@ public class AppPage extends AHSView {
protected String getAttemptsTableColumnDefs() { protected String getAttemptsTableColumnDefs() {
StringBuilder sb = new StringBuilder(); 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(", 'mRender': parseHadoopID }")
.append("\n, {'sType':'numeric', 'aTargets': [1]") .append("\n, {'sType':'numeric', 'aTargets': [1]")

View File

@ -158,8 +158,6 @@ public class AppAttemptBlock extends HtmlBlock {
StringBuilder containersTableData = new StringBuilder("[\n"); StringBuilder containersTableData = new StringBuilder("[\n");
for (ContainerReport containerReport : containers) { for (ContainerReport containerReport : containers) {
ContainerInfo container = new ContainerInfo(containerReport); ContainerInfo container = new ContainerInfo(containerReport);
// ConatinerID numerical value parsed by parseHadoopID in
// yarn.dt.plugins.js
containersTableData containersTableData
.append("[\"<a href='") .append("[\"<a href='")
.append(url("container", container.getContainerId())) .append(url("container", container.getContainerId()))

View File

@ -285,8 +285,6 @@ public class AppBlock extends HtmlBlock {
logsLink = containerReport.getLogUrl(); logsLink = containerReport.getLogUrl();
nodeLink = containerReport.getNodeHttpAddress(); nodeLink = containerReport.getNodeHttpAddress();
} }
// AppAttemptID numerical value parsed by parseHadoopID in
// yarn.dt.plugins.js
attemptsTableData attemptsTableData
.append("[\"<a href='") .append("[\"<a href='")
.append(url("appattempt", appAttempt.getAppAttemptId())) .append(url("appattempt", appAttempt.getAppAttemptId()))

View File

@ -124,7 +124,6 @@ public class AppsBlock extends HtmlBlock {
} }
AppInfo app = new AppInfo(appReport); AppInfo app = new AppInfo(appReport);
String percent = String.format("%.1f", app.getProgress()); String percent = String.format("%.1f", app.getProgress());
// AppID numerical value parsed by parseHadoopID in yarn.dt.plugins.js
appsTableData appsTableData
.append("[\"<a href='") .append("[\"<a href='")
.append(url("app", app.getAppId())) .append(url("app", app.getAppId()))

View File

@ -116,7 +116,6 @@ public class FairSchedulerAppsBlock extends HtmlBlock {
// FairScheduler#applications don't have the entry. Skip it. // FairScheduler#applications don't have the entry. Skip it.
continue; continue;
} }
//AppID numerical value parsed by parseHadoopID in yarn.dt.plugins.js
appsTableData.append("[\"<a href='") appsTableData.append("[\"<a href='")
.append(url("app", appInfo.getAppId())).append("'>") .append(url("app", appInfo.getAppId())).append("'>")
.append(appInfo.getAppId()).append("</a>\",\"") .append(appInfo.getAppId()).append("</a>\",\"")

View File

@ -172,8 +172,6 @@ public class RMAppBlock extends AppBlock{
blacklistedNodesCount = String.valueOf(nodes.size()); blacklistedNodesCount = String.valueOf(nodes.size());
} }
// AppAttemptID numerical value parsed by parseHadoopID in
// yarn.dt.plugins.js
attemptsTableData attemptsTableData
.append("[\"<a href='") .append("[\"<a href='")
.append(url("appattempt", appAttempt.getAppAttemptId())) .append(url("appattempt", appAttempt.getAppAttemptId()))

View File

@ -81,7 +81,6 @@ public class RMAppsBlock extends AppsBlock {
blacklistedNodesCount = String.valueOf(nodes.size()); blacklistedNodesCount = String.valueOf(nodes.size());
} }
String percent = String.format("%.1f", app.getProgress()); String percent = String.format("%.1f", app.getProgress());
// AppID numerical value parsed by parseHadoopID in yarn.dt.plugins.js
appsTableData appsTableData
.append("[\"<a href='") .append("[\"<a href='")
.append(url("app", app.getAppId())) .append(url("app", app.getAppId()))