diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 47f4722f7b5..9c82619ca64 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -155,6 +155,9 @@ Release 0.23.6 - UNRELEASED
YARN-214. RMContainerImpl does not handle event EXPIRE at state RUNNING
(jeagles via bobby)
+ YARN-151. Browser thinks RM main page JS is taking too long
+ (Ravi Prakash via bobby)
+
Release 0.23.5 - UNRELEASED
INCOMPATIBLE CHANGES
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 17c1b27d0ce..5d78aaaf7fb 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
@@ -106,3 +106,11 @@ function parseHadoopID(data, type, full) {
var splits = data.split('_');
return splits[parseInt(splits.length-1)].split('<')[0];
}
+
+function parseHadoopProgress(data, type, full) {
+ if (type === 'display') {
+ return data;
+ }
+ //Return the title attribute for 'sort', 'filter', 'type' and undefined
+ return data.split("'")[1];
+}
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/AppsBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java
index 12d5554e9cd..fad5dd82591 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppsBlock.java
@@ -20,12 +20,13 @@ package org.apache.hadoop.yarn.server.resourcemanager.webapp;
import static org.apache.hadoop.yarn.util.StringHelper.join;
import static org.apache.hadoop.yarn.webapp.YarnWebParams.APP_STATE;
-import static org.apache.hadoop.yarn.webapp.view.JQueryUI._PROGRESSBAR;
-import static org.apache.hadoop.yarn.webapp.view.JQueryUI._PROGRESSBAR_VALUE;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.C_PROGRESSBAR;
+import static org.apache.hadoop.yarn.webapp.view.JQueryUI.C_PROGRESSBAR_VALUE;
import java.util.Collection;
import java.util.HashSet;
+import org.apache.commons.lang.StringEscapeUtils;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppInfo;
@@ -72,41 +73,50 @@ class AppsBlock extends HtmlBlock {
reqAppStates.add(RMAppState.valueOf(stateString));
}
}
+ StringBuilder appsTableData = new StringBuilder("[\n");
for (RMApp app : list.apps.values()) {
if (reqAppStates != null && !reqAppStates.contains(app.getState())) {
continue;
}
AppInfo appInfo = new AppInfo(app, true);
String percent = String.format("%.1f", appInfo.getProgress());
- String startTime = Times.format(appInfo.getStartTime());
- String finishTime = Times.format(appInfo.getFinishTime());
- tbody.
- tr().
- td().
- br().$title(appInfo.getAppIdNum())._(). // for sorting
- a(url("app", appInfo.getAppId()), appInfo.getAppId())._().
- td(appInfo.getUser()).
- td(appInfo.getName()).
- td(appInfo.getQueue()).
- td().
- br().$title(String.valueOf(appInfo.getStartTime()))._().
- _(startTime)._().
- td().
- br().$title(String.valueOf(appInfo.getFinishTime()))._().
- _(finishTime)._().
- td(appInfo.getState()).
- td(appInfo.getFinalStatus()).
- td().
- br().$title(percent)._(). // for sorting
- div(_PROGRESSBAR).
- $title(join(percent, '%')). // tooltip
- div(_PROGRESSBAR_VALUE).
- $style(join("width:", percent, '%'))._()._()._().
- td().
- a(!appInfo.isTrackingUrlReady()?
- "#" : appInfo.getTrackingUrlPretty(), appInfo.getTrackingUI())._()._();
+ //AppID numerical value parsed by parseHadoopID in yarn.dt.plugins.js
+ appsTableData.append("[\"")
+ .append(appInfo.getAppId()).append("\",\"")
+ .append(StringEscapeUtils.escapeHtml(appInfo.getUser()))
+ .append("\",\"")
+ .append(StringEscapeUtils.escapeHtml(appInfo.getName()))
+ .append("\",\"")
+ .append(StringEscapeUtils.escapeHtml(appInfo.getQueue()))
+ .append("\",\"")
+ .append(appInfo.getStartTime()).append("\",\"")
+ .append(appInfo.getFinishTime()).append("\",\"")
+ .append(appInfo.getState()).append("\",\"")
+ .append(appInfo.getFinalStatus()).append("\",\"")
+ // Progress bar
+ .append("