diff --git a/LICENSE.txt b/LICENSE.txt index e3a4c34aa0..8f418afc4c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -2328,6 +2328,7 @@ The Apache Hadoop YARN Web UI component bundles the following files under the MI - datatables v1.10.8 (https://datatables.net/) - moment v2.10.6 (http://momentjs.com/) - Copyright (c) 2011-2015 Tim Wood, Iskren Chernev, Moment.js contributors - em-helpers v0.5.8 (https://github.com/sreenaths/em-helpers) + - ember-array-contains-helper v1.0.2 (https://github.com/bmeurant/ember-array-contains-helper) - ember-cli-app-version v0.5.8 (https://github.com/EmberSherpa/ember-cli-app-version) - Authored by Taras Mankovski - ember-cli-babel v5.1.6 (https://github.com/babel/ember-cli-babel) - Authored by Stefan Penner - ember-cli-content-security-policy v0.4.0 (https://github.com/rwjblue/ember-cli-content-security-policy) @@ -2341,6 +2342,7 @@ The Apache Hadoop YARN Web UI component bundles the following files under the MI - ember-cli-sri v1.2.1 (https://github.com/jonathanKingston/ember-cli-sri) - Authored by Jonathan Kingston - ember-cli-uglify v1.2.0 (github.com/ember-cli/ember-cli-uglify) - Authored by Robert Jackson - ember-d3 v0.1.0 (https://github.com/brzpegasus/ember-d3) - Authored by Estelle DeBlois + - ember-truth-helpers v1.2.0 (https://github.com/jmurphyau/ember-truth-helpers) - select2 v4.0.0 (https://select2.github.io/) All rights reserved. diff --git a/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-dist.xml b/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-dist.xml index 219ed817d0..c3f459cb9c 100644 --- a/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-dist.xml +++ b/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-dist.xml @@ -192,6 +192,13 @@ ${project.build.directory}/site /share/doc/hadoop/${hadoop.component} + + hadoop-yarn/hadoop-yarn-ui/target/hadoop-yarn-ui-${project.version} + /share/hadoop/${hadoop.component}/webapps/rm + + **/* + + diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java index 3f84a23378..0134465c18 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java @@ -262,7 +262,30 @@ private static void addDeprecatedKeys() { public static final int DEFAULT_RM_WEBAPP_HTTPS_PORT = 8090; public static final String DEFAULT_RM_WEBAPP_HTTPS_ADDRESS = "0.0.0.0:" + DEFAULT_RM_WEBAPP_HTTPS_PORT; + + /** + * Enable YARN WebApp V2. + */ + public static final String RM_WEBAPP_UI2_ENABLE = RM_PREFIX + + "webapp.ui2.enable"; + public static final boolean DEFAULT_RM_WEBAPP_UI2_ENABLE = false; + + /** The address of the RM web ui2 application. */ + public static final String RM_WEBAPP_UI2_ADDRESS = RM_PREFIX + + "webapp.ui2.address"; + + public static final int DEFAULT_RM_WEBAPP_UI2_PORT = 8288; + public static final String DEFAULT_RM_WEBAPP_UI2_ADDRESS = "0.0.0.0:" + + DEFAULT_RM_WEBAPP_UI2_PORT; + /** The https address of the RM web ui2 application.*/ + public static final String RM_WEBAPP_UI2_HTTPS_ADDRESS = + RM_PREFIX + "webapp.ui2.https.address"; + + public static final int DEFAULT_RM_WEBAPP_UI2_HTTPS_PORT = 8290; + public static final String DEFAULT_RM_WEBAPP_UI2_HTTPS_ADDRESS = "0.0.0.0:" + + DEFAULT_RM_WEBAPP_UI2_HTTPS_PORT; + public static final String RM_RESOURCE_TRACKER_ADDRESS = RM_PREFIX + "resource-tracker.address"; public static final int DEFAULT_RM_RESOURCE_TRACKER_PORT = 8031; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml index c265e86324..0e46dbdcbb 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml @@ -179,6 +179,32 @@ true + + To enable RM web ui2 application. + yarn.resourcemanager.webapp.ui2.enable + false + + + + + The http address of the RM web ui2 application. + If only a host is provided as the value, + the webapp will be served on a random port. + + yarn.resourcemanager.webapp.ui2.address + ${yarn.resourcemanager.hostname}:8288 + + + + + The https address of the RM web ui2 application. + If only a host is provided as the value, + the webapp will be served on a random port. + + yarn.resourcemanager.webapp.ui2.https.address + ${yarn.resourcemanager.hostname}:8290 + + yarn.resourcemanager.resource-tracker.address ${yarn.resourcemanager.hostname}:8031 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java index d2d706d05a..d32f64936f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java @@ -18,16 +18,6 @@ package org.apache.hadoop.yarn.server.resourcemanager; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintStream; -import java.net.InetSocketAddress; -import java.nio.charset.Charset; -import java.security.PrivilegedExceptionAction; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.List; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.curator.framework.AuthInfo; @@ -38,10 +28,12 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.ha.HAServiceProtocol; import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState; +import org.apache.hadoop.http.HttpServer2; import org.apache.hadoop.http.lib.StaticUserWebFilter; import org.apache.hadoop.metrics2.MetricsSystem; import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem; import org.apache.hadoop.metrics2.source.JvmMetrics; +import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.security.AuthenticationFilterInitializer; import org.apache.hadoop.security.Groups; import org.apache.hadoop.security.HttpCrossOriginFilterInitializer; @@ -124,6 +116,16 @@ import org.apache.zookeeper.server.auth.DigestAuthenticationProvider; import com.google.common.annotations.VisibleForTesting; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.InetSocketAddress; +import java.net.URI; +import java.nio.charset.Charset; +import java.security.PrivilegedExceptionAction; +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.List; /** * The ResourceManager is the main class that is a set of components. @@ -909,7 +911,49 @@ public void handle(RMNodeEvent event) { } } } - + + /** + * Return a HttpServer.Builder that the journalnode / namenode / secondary + * namenode can use to initialize their HTTP / HTTPS server. + * + */ + public static HttpServer2.Builder httpServerTemplateForRM(Configuration conf, + final InetSocketAddress httpAddr, final InetSocketAddress httpsAddr, + String name) throws IOException { + HttpServer2.Builder builder = new HttpServer2.Builder().setName(name) + .setConf(conf).setSecurityEnabled(false); + + if (httpAddr.getPort() == 0) { + builder.setFindPort(true); + } + + URI uri = URI.create("http://" + NetUtils.getHostPortString(httpAddr)); + builder.addEndpoint(uri); + LOG.info("Starting Web-server for " + name + " at: " + uri); + + return builder; + } + + protected void startWebAppV2() throws IOException { + Configuration config = getConfig(); + final InetSocketAddress httpAddr = config.getSocketAddr( + YarnConfiguration.RM_WEBAPP_UI2_ADDRESS, + YarnConfiguration.DEFAULT_RM_WEBAPP_UI2_ADDRESS, + YarnConfiguration.DEFAULT_RM_WEBAPP_UI2_PORT); + final InetSocketAddress httpsAddr = config.getSocketAddr( + YarnConfiguration.RM_WEBAPP_UI2_HTTPS_ADDRESS, + YarnConfiguration.DEFAULT_RM_WEBAPP_UI2_HTTPS_ADDRESS, + YarnConfiguration.DEFAULT_RM_WEBAPP_UI2_HTTPS_PORT); + + HttpServer2.Builder builder = httpServerTemplateForRM(config, httpAddr, + httpsAddr, "rm"); + + HttpServer2 infoServer = builder.build(); + infoServer.start(); + + LOG.info("Web server init done"); + } + protected void startWepApp() { // Use the customized yarn filter instead of the standard kerberos filter to @@ -1128,6 +1172,16 @@ protected void serviceStart() throws Exception { transitionToActive(); } + if (getConfig().getBoolean(YarnConfiguration.RM_WEBAPP_UI2_ENABLE, + YarnConfiguration.DEFAULT_RM_WEBAPP_UI2_ENABLE)) { + try { + startWebAppV2(); + LOG.info("Yarn WebApp UI 2 is started"); + } catch (Exception e) { + LOG.error("Failed to start Yarn web app v2:" + e.getMessage()); + } + } + startWepApp(); if (getConfig().getBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER, false)) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/pom.xml index 66bf54a0b1..6d46fdab40 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/pom.xml @@ -20,12 +20,12 @@ hadoop-yarn org.apache.hadoop - 3.0.0-SNAPSHOT + 3.0.0-alpha1-SNAPSHOT 4.0.0 org.apache.hadoop hadoop-yarn-ui - 3.0.0-SNAPSHOT + 3.0.0-alpha1-SNAPSHOT Apache Hadoop YARN UI ${packaging.type} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app-attempt.js index d10ba45fd4..78f5e02df0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app-attempt.js @@ -31,10 +31,8 @@ export default AbstractAdapter.extend({ urlForFindRecord(id, modelName, snapshot) { var url = this._buildURL(); - var url = url + '/apps/' + + return url + '/apps/' + Converter.attemptIdToAppId(id) + "/appattempts/" + id; - console.log('app-attempt url:',url); - return url; } }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-container-log.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-container-log.js index 39c3c87be7..9f2d5d7047 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-container-log.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-container-log.js @@ -42,7 +42,7 @@ export default DS.RESTAdapter.extend({ var nodeHttpAddr = splits[0]; var containerId = splits[1]; var filename = splits[2]; - this.host = this.host + nodeHttpAddr; + this.host = this.get('host') + nodeHttpAddr; var url = this._buildURL(); url = url + "/containerlogs/" + containerId + "/" + filename; return url; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-app.js index fd6c0210b5..eaddfcbf6e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-app.js @@ -25,14 +25,20 @@ export default AbstractAdapter.extend({ serverName: "NM", urlForQuery(query) { - this.host = this.get("host") + query.nodeAddr; + var extension = this.get("host").split('/').pop(); + if (extension != query.nodeAddr) { + this.host = this.get("host") + query.nodeAddr; + } var url = this._buildURL(); url = url + "/apps"; return url; }, urlForQueryRecord: function (query) { - this.host = this.get("host") + query.nodeAddr; + var extension = this.get("host").split('/').pop(); + if (extension != query.nodeAddr) { + this.host = this.get("host") + query.nodeAddr; + } var url = this._buildURL(); url = url + "/apps/" + query.appId; return url; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-container.js index caf1e3fb5c..56c4bcd741 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node-container.js @@ -25,14 +25,20 @@ export default AbstractAdapter.extend({ serverName: "NM", urlForQuery(query) { - this.host = this.get("host") + query.nodeHttpAddr; + var extension = this.get("host").split('/').pop(); + if (extension != query.nodeHttpAddr) { + this.host = this.get("host") + query.nodeHttpAddr; + } var url = this._buildURL(); url = url + "/containers"; return url; }, urlForQueryRecord(query) { - this.host = this.get("host") + query.nodeHttpAddr; + var extension = this.get("host").split('/').pop(); + if (extension != query.nodeHttpAddr) { + this.host = this.get("host") + query.nodeHttpAddr; + } var url = this._buildURL(); url = url + "/containers/" + query.containerId; return url; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node.js index c9f36c3a47..7a0fc4ac00 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-node.js @@ -25,7 +25,10 @@ export default AbstractAdapter.extend({ serverName: "NM", urlForFindRecord(id, modelName, snapshot) { - this.host = this.get("host") + id; + var extension = this.get("host").split('/').pop(); + if (extension != id) { + this.host = this.get("host") + id; + } var url = this._buildURL(); return url; }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js index b92f4bfb6a..8a2b3de3f2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js @@ -225,18 +225,27 @@ export default Ember.Component.extend({ didInsertElement: function() { // init tooltip this.initTooltip(); + this.modelArr = []; // init model if (this.get("rmModel")) { this.get("rmModel").forEach(function(o) { - this.modelArr.push(o); + if(!this.modelArr.contains(o)) { + this.modelArr.push(o); + } }.bind(this)); } if (this.get("tsModel")) { - this.get("tsModel").forEach(function(o) { - this.modelArr.push(o); - }.bind(this)); + this.get("tsModel").forEach(function(o) { + if(!this.modelArr.contains(o)) { + this.modelArr.push(o); + } + }.bind(this)); + } + + if(this.modelArr.length == 0) { + return; } this.modelArr.sort(function(a, b) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js index 698c253d31..1af98aba32 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/tree-selector.js @@ -126,7 +126,7 @@ export default Ember.Component.extend({ .attr("transform", function(d) { return "translate(" + source.y0 + "," + source.x0 + ")"; }) .on("click", function(d,i){ if (d.queueData.get("name") != this.get("selected")) { - document.location.href = "yarn-queue/" + d.queueData.get("name"); + document.location.href = "#/yarn-queue/" + d.queueData.get("name"); } }.bind(this)); // .on("click", click); @@ -176,7 +176,7 @@ export default Ember.Component.extend({ .attr("r", 20) .attr("href", function(d) { - return "yarn-queues/" + d.queueData.get("name"); + return "#/yarn-queues/" + d.queueData.get("name"); }) .style("stroke", function(d) { if (d.queueData.get("name") == this.get("selected")) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/log-files-comma.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/log-files-comma.js index b6b57eca07..192e1ed8c3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/log-files-comma.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/log-files-comma.js @@ -36,7 +36,7 @@ export default Ember.Helper.helper(function(params,hash) { var html = ''; var logFilesCommaSeparated = ""; for (var i = 0; i < logFilesLen; i++) { - html = html + '' + logFiles[i] + ''; if (i != logFilesLen - 1) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-link.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-link.js index 331f082ff6..e524f08c7b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-link.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-link.js @@ -29,7 +29,7 @@ export default Ember.Helper.helper(function(params,hash) { if (nodeState == "SHUTDOWN" || nodeState == "LOST") { html = html + nodeHTTPAddress; } else { - html = html + '' + + html = html + '' + nodeHTTPAddress + ''; } html = html + ''; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-menu.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-menu.js index 2538d7dc49..d4a73a42db 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-menu.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-menu.js @@ -50,17 +50,17 @@ export default Ember.Helper.helper(function(params,hash) { if (hash.path == 'yarn-node') { html = html + ' class="active"'; } - html = html + '>Node InformationList of ApplicationsList of Containers'; return Ember.String.htmlSafe(html); }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-name.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-name.js new file mode 100644 index 0000000000..56ce373be5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/node-name.js @@ -0,0 +1,46 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export function nodeName(params/*, hash*/) { + // Place a menu within a panel inside col-md-2 container. + console.log('nodes-uid', params[0]); + var nodeIdSplitAtPort = params[0]; + var portIndex = nodeIdSplitAtPort.indexOf(':'); + if (portIndex != -1) { + nodeIdSplitAtPort = nodeIdSplitAtPort.substring(0, portIndex) + + ':​' + nodeIdSplitAtPort.substring(portIndex + 1); + } + var normalizedNodeId = ''; + var splitsAlongDots = nodeIdSplitAtPort.split('.'); + if (splitsAlongDots) { + var len = splitsAlongDots.length; + for (var i = 0; i < len; i++) { + normalizedNodeId = normalizedNodeId + splitsAlongDots[i]; + if (i != len - 1) { + normalizedNodeId = normalizedNodeId + '.​'; + } + } + } else { + normalizedNodeId = nodeIdSplitAtPort; + } + return Ember.String.htmlSafe(normalizedNodeId); +} + +export default Ember.Helper.helper(nodeName); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js index 8079907b69..b913a33643 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app-attempt.js @@ -21,14 +21,29 @@ import Converter from 'yarn-ui/utils/converter'; export default DS.Model.extend({ startTime: DS.attr('string'), + startedTime: DS.attr('string'), finishedTime: DS.attr('string'), containerId: DS.attr('string'), + amContainerId: DS.attr('string'), nodeHttpAddress: DS.attr('string'), nodeId: DS.attr('string'), + hosts: DS.attr('string'), logsLink: DS.attr('string'), + state: DS.attr('string'), + + attemptStartedTime: function() { + var startTime = this.get("startTime"); + // If startTime variable is not present, get from startedTime + if (startTime == undefined || + startTime == "Invalid date") { + startTime = this.get("startedTime"); + } + + return startTime; + }.property("startedTime"), startTs: function() { - return Converter.dateToTimeStamp(this.get("startTime")); + return Converter.dateToTimeStamp(this.get('attemptStartedTime')); }.property("startTime"), finishedTs: function() { @@ -36,11 +51,57 @@ export default DS.Model.extend({ return ts; }.property("finishedTime"), + validatedFinishedTs: function() { + if (this.get("finishedTs") < this.get("startTs")) { + return ""; + } + return this.get("finishedTime"); + }.property("finishedTime"), + shortAppAttemptId: function() { + if (!this.get("containerId")) { + return this.get("id"); + } return "attempt_" + parseInt(Converter.containerIdToAttemptId(this.get("containerId")).split("_")[3]); }.property("containerId"), + appMasterContainerId: function() { + var id = this.get("containerId"); + // If containerId variable is not present, get from amContainerId + if (id == undefined) { + id = this.get("amContainerId"); + } + return id; + }.property("amContainerId"), + + IsAmNodeUrl: function() { + var url = this.get("nodeHttpAddress"); + // If nodeHttpAddress variable is not present, hardcode it. + if (url == undefined) { + url = "Not Available"; + } + return url != "Not Available"; + }.property("nodeHttpAddress"), + + amNodeId : function() { + var id = this.get("nodeId"); + // If nodeId variable is not present, get from host + if (id == undefined) { + id = this.get("hosts"); + } + return id; + }.property("nodeId"), + + IsLinkAvailable: function() { + var url = this.get("logsLink"); + // If logsLink variable is not present, hardcode its. + if (url == undefined) { + url = "Not Available"; + } + return url != "Not Available"; + }.property("logsLink"), + elapsedTime: function() { var elapsedMs = this.get("finishedTs") - this.get("startTs"); if (elapsedMs <= 0) { @@ -59,4 +120,13 @@ export default DS.Model.extend({ link: function() { return "/yarn-app-attempt/" + this.get("id"); }.property(), + + linkname: function() { + return "yarn-app-attempt"; + }.property(), + + attemptState: function() { + return this.get("state"); + }.property(), + }); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js index 1d506c25a2..a96c17ce58 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-app.js @@ -51,6 +51,13 @@ export default DS.Model.extend({ return this.get('finalStatus') == "FAILED" }.property("finalStatus"), + validatedFinishedTs: function() { + if (this.get("finishedTime") < this.get("startTime")) { + return ""; + } + return this.get("finishedTime"); + }.property("finishedTime"), + allocatedResource: function() { return Converter.resourceToString(this.get("allocatedMB"), this.get("allocatedVCores")); }.property("allocatedMB", "allocatedVCores"), @@ -67,6 +74,13 @@ export default DS.Model.extend({ return "width: " + this.get("progress") + "%"; }.property("progress"), + runningContainersNumber: function() { + if(this.get("runningContainers") < 0) { + return 0; + } + return this.get("runningContainers"); + }.property("progress"), + finalStatusStyle: function() { var style = "default"; var finalStatus = this.get("finalStatus"); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js index b745296249..bd9cea77f3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-container.js @@ -40,6 +40,13 @@ export default DS.Model.extend({ return ts; }.property("finishedTime"), + validatedFinishedTs: function() { + if (this.get("finishedTs") < this.get("startTs")) { + return ""; + } + return this.get("finishedTime"); + }.property("finishedTime"), + elapsedTime: function() { var elapsedMs = this.get("finishedTs") - this.get("startTs"); if (elapsedMs <= 0) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js index a65118d941..a8f27f5fb3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app-attempt.js @@ -33,7 +33,11 @@ export default Ember.Route.extend({ { app_attempt_id: param.app_attempt_id, is_rm: false - }), + }).catch (function() { + // Promise rejected, fulfill with some default value to + // use as the route's model and continue on with the transition + return []; + }) }); } }); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-attempt.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-attempt.js index 291589c2d2..4c542c48f1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-attempt.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app-attempt.js @@ -32,11 +32,14 @@ export default DS.JSONAPISerializer.extend({ type: primaryModelClass.modelName, // yarn-app attributes: { startTime: Converter.timeStampToDate(payload.startTime), + startedTime: Converter.timeStampToDate(payload.startedTime), finishedTime: Converter.timeStampToDate(payload.finishedTime), containerId: payload.containerId, + amContainerId: payload.amContainerId, nodeHttpAddress: payload.nodeHttpAddress, nodeId: payload.nodeId, - state: payload.nodeId, + hosts: payload.host, + state: payload.appAttemptState, logsLink: payload.logsLink } }; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js index 234ad24477..ba8c1f4eec 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js @@ -75,10 +75,15 @@ export default DS.JSONAPISerializer.extend({ // payload has apps : { app: [ {},{},{} ] } // need some error handling for ex apps or app may not be defined. - normalizedArrayResponse.data = payload.apps.app.map(singleApp => { - return this.internalNormalizeSingleResponse(store, primaryModelClass, + if(payload.apps) { + normalizedArrayResponse.data = payload.apps.app.map(singleApp => { + return this.internalNormalizeSingleResponse(store, primaryModelClass, singleApp, singleApp.id, requestType); - }, this); + }, this); + } else { + normalizedArrayResponse.data = []; + } + return normalizedArrayResponse; } }); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js index 6f0386ffe0..e0513967ca 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-container.js @@ -64,9 +64,10 @@ export default DS.JSONAPISerializer.extend({ singleContainer, singleContainer.id, requestType); }, this); return normalizedArrayResponse; + } else { + normalizedArrayResponse.data = []; } - normalizedArrayResponse.data = []; return normalizedArrayResponse; } }); \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js index 8b1f152fdf..59458133de 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-app.js @@ -76,10 +76,7 @@ export default DS.JSONAPISerializer.extend({ } else { // No container reported inside containers. // Response of the form { "apps": null } - normalizedArrayResponse.data = Ember.makeArray({ - id: "dummy", - type: primaryModelClass.modelName, - attributes: {}}); + normalizedArrayResponse.data = []; } return normalizedArrayResponse; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js index 528f2fefd1..a104f1ecf6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-node-container.js @@ -64,10 +64,7 @@ export default DS.JSONAPISerializer.extend({ } else { // No container reported inside containers. // Response of the form { "containers": null } - normalizedArrayResponse.data = Ember.makeArray({ - id: "dummy", - type: primaryModelClass.modelName, - attributes: {}}); + normalizedArrayResponse.data = []; } return normalizedArrayResponse; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-node.js index 6cb9320076..6feab3633b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-node.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-rm-node.js @@ -67,10 +67,7 @@ export default DS.JSONAPISerializer.extend({ singleNode, singleNode.id); }, this); } else { - normalizedArrayResponse.data = Ember.makeArray({ - id: "dummy", - type: primaryModelClass.modelName, - attributes: {}}); + normalizedArrayResponse.data = []; } return normalizedArrayResponse; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs index 88702c4ad6..b45ec6bc2a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs @@ -32,7 +32,26 @@ diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs index 722f7805a7..2b16f86cc6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs @@ -24,23 +24,39 @@ Start Time - {{attempt.startTime}} + {{attempt.attemptStartedTime}} AM Container Id - {{attempt.containerId}} + {{attempt.appMasterContainerId}} + {{#if attempt.IsAmNodeUrl}} AM Node Web UI {{attempt.nodeHttpAddress}} + {{/if}} AM Node Id - {{attempt.nodeId}} + {{attempt.amNodeId}} + {{#if attempt.IsLinkAvailable}} Log link + {{/if}} + {{#if attempt.attemptState}} + + Attempt State + {{attempt.attemptState}} + + {{/if}} + {{#if attempt.elapsedTime}} + + Elapsed Time + {{attempt.elapsedTime}} + + {{/if}} \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-table.hbs index 6e8badc62f..0788d9c240 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-table.hbs @@ -36,7 +36,7 @@ {{#if arr}} {{#each arr as |app|}} - {{app.id}} + {{app.id}} {{app.appName}} {{app.user}} {{app.queue}} @@ -44,7 +44,7 @@ {{app.finalStatus}} {{app.startTime}} {{app.elapsedTime}} - {{app.finishedTime}} + {{app.validatedFinishedTs}} {{app.priority}}
@@ -57,7 +57,7 @@ {{/each}} {{else}} - {{app.id}} + {{app.id}} {{app.appName}} {{app.user}} {{app.queue}} @@ -65,7 +65,7 @@ {{app.finalStatus}} {{app.startTime}} {{app.elapsedTime}} - {{app.finishedTime}} + {{app.validatedFinishedTs}} {{app.priority}}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs index dcc31da02f..0736a6962d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/container-table.hbs @@ -24,7 +24,7 @@ Finished Time - {{container.finishedTime}} + {{container.validatedFinishedTs}} Elapsed Time @@ -48,7 +48,7 @@ NodeManager UI - {{container.nodeHttpAddress}} + {{container.nodeHttpAddress}} \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/node-menu-panel.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/node-menu-panel.hbs new file mode 100644 index 0000000000..1e07e899df --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/node-menu-panel.hbs @@ -0,0 +1,44 @@ +{{! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +}} + +
+
+
+

Node Manager
({{node-name nodeId}})

+
+
+ +
+
+
+{{outlet}} \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs index 2eb3441b4a..6f529ba8f0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs @@ -34,7 +34,7 @@
{{#if selected.link}} - {{selected.id}} + {{#link-to selected.linkname selected.id}}{{selected.id}}{{/link-to}} {{else}} {{selected.id}} {{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/error.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/error.hbs index c546bf7004..2e2a6e5f5d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/error.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/error.hbs @@ -16,4 +16,4 @@ limitations under the License. --}} -

Sorry, Error Occured.

+

Sorry, Error Occurred.

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs index a0343b5b99..b01eceb302 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs @@ -18,12 +18,16 @@
+ {{#if model.attempt}} {{app-attempt-table attempt=model.attempt}} + {{/if}}
+ {{#if (or model.rmContainers model.tsContainers)}} {{timeline-view parent-id="containers-timeline-div" my-id="timeline-view" height="400" rmModel=model.rmContainers tsModel=model.tsContainers label="shortAppAttemptId" attemptModel=false}} + {{/if}}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs index d306e641eb..2bc20f2b65 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs @@ -61,7 +61,7 @@ Running Containers - {{model.app.runningContainers}} + {{model.app.runningContainersNumber}} Preempted Resource diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps.hbs index 98b9107a5d..0fc6edf85f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps.hbs @@ -15,7 +15,10 @@ * See the License for the specific language governing permissions and * limitations under the License. }} - -{{app-table table-id="apps-table" arr=model}} -{{simple-table table-id="apps-table" bFilter=true colsOrder="0,desc" colTypes="natural elapsed-time" colTargets="0 7"}} +{{#if model}} + {{app-table table-id="apps-table" arr=model}} + {{simple-table table-id="apps-table" bFilter=true colsOrder="0,desc" colTypes="natural elapsed-time" colTargets="0 7"}} +{{else}} +

Could not find any applications from this cluster

+{{/if}} {{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-app.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-app.hbs index dfd6fb5533..1551957cd4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-app.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-app.hbs @@ -18,7 +18,7 @@
- {{node-menu path="yarn-node-app" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}} + {{node-menu-panel path="yarn-node-app" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
Application Information
@@ -48,7 +48,7 @@ {{#each model.nodeApp.containers as |container|}} - {{container}} + {{container}} {{/each}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-apps.hbs index d897afc9be..42de7ebbe7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-apps.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-apps.hbs @@ -18,7 +18,8 @@
- {{node-menu path="yarn-node-apps" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}} + {{node-menu-panel path="yarn-node-apps" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}} + {{#if model.apps}}
@@ -31,21 +32,20 @@ {{#if model.apps}} {{#each model.apps as |app|}} - {{#if app.isDummyApp}} - - {{else}} - + - {{/if}} {{/each}} {{/if}}
No apps found on this node
{{app.appId}}{{app.appId}} {{app.state}} {{app.user}}
{{simple-table table-id="node-apps-table" bFilter=true colsOrder="0,desc" colTypes="natural" colTargets="0"}}
+ {{else}} +

No apps found on this node

+ {{/if}}
{{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-container.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-container.hbs index 8ddbae5621..4104eec89a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-container.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-container.hbs @@ -18,7 +18,7 @@
- {{node-menu path="yarn-node-container" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}} + {{node-menu-panel path="yarn-node-container" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
Container Information
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-containers.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-containers.hbs index 65a67a8f04..3ebcc6f2b1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-containers.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node-containers.hbs @@ -18,7 +18,8 @@
- {{node-menu path="yarn-node-containers" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}} + {{node-menu-panel path="yarn-node-containers" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}} + {{#if model.containers}}
@@ -32,11 +33,8 @@ {{#if model.containers}} {{#each model.containers as |container|}} - {{#if container.isDummyContainer}} - - {{else}} - + - {{/if}} {{/each}} {{/if}}
No containers found on this node
{{container.containerId}}{{container.containerId}} {{container.state}} {{container.user}} @@ -46,13 +44,15 @@ logFiles=container.containerLogFiles}}
{{simple-table table-id="node-containers-table" bFilter=true colsOrder="0,desc" colTypes="natural" colTargets="0"}}
+ {{else}} +

No containers found on this node

+ {{/if}}
{{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node.hbs index d92a70a125..d6f30ecbd1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-node.hbs @@ -18,7 +18,7 @@
- {{node-menu path="yarn-node" nodeId=model.rmNode.id nodeAddr=model.node.id}} + {{node-menu-panel path="yarn-node" nodeId=model.rmNode.id nodeAddr=model.node.id}}
Node Information
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs index bf2a098254..3c7849820b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs @@ -16,6 +16,7 @@ limitations under the License. --}} +{{#if model}} @@ -35,11 +36,7 @@ - {{#if model}} {{#each model as |node|}} - {{#if node.isDummyNode}} - - {{else}} @@ -55,11 +52,12 @@ - {{/if}} {{/each}} - {{/if}}
No nodes found on this cluster
{{node.nodeLabelsAsString}} {{node.rack}}{{node.availableVirtualCores}} {{node.version}}
{{simple-table table-id="nodes-table" bFilter=true}} +{{else}} +

No nodes found on this cluster

+{{/if}} {{outlet}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue.hbs index 51a4fb40b5..8ce4ffa144 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue.hbs @@ -58,8 +58,12 @@
- {{app-table table-id="apps-table" arr=model.apps}} - {{simple-table table-id="apps-table" bFilter=true colTypes="elapsed-time" colTargets="7"}} + {{#if model.apps}} + {{app-table table-id="apps-table" arr=model.apps}} + {{simple-table table-id="apps-table" bFilter=true colTypes="elapsed-time" colTargets="7"}} + {{else}} +

Could not find any applications from this cluster

+ {{/if}}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/environment.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/environment.js index 118e0ba49d..3c478bee77 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/environment.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/environment.js @@ -25,7 +25,7 @@ module.exports = function(environment) { modulePrefix: 'yarn-ui', environment: environment, baseURL: '/', - locationType: 'auto', + locationType: 'hash', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json index 40febda3c1..417eb980c5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json @@ -22,6 +22,7 @@ "broccoli-asset-rev": "2.4.2", "broccoli-funnel": "1.0.1", "ember-bootstrap": "0.5.1", + "ember-array-contains-helper": "1.0.2", "ember-cli": "1.13.13", "ember-cli-app-version": "1.0.0", "ember-cli-babel": "5.1.6", @@ -42,6 +43,7 @@ "ember-export-application-global": "1.0.5", "ember-resolver": "2.0.3", "ember-spin-spinner": "0.2.3", + "ember-truth-helpers": "1.2.0", "select2": "4.0.0" } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/helpers/node-name-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/helpers/node-name-test.js new file mode 100644 index 0000000000..8ff5eb6022 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/helpers/node-name-test.js @@ -0,0 +1,28 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { nodeName } from '../../../helpers/node-name'; +import { module, test } from 'qunit'; + +module('Unit | Helper | node name'); + +// Replace this with your real tests. +test('it works', function(assert) { + let result = nodeName(42); + assert.ok(result); +});