diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebServices.java index 7476d759edc..77020044a17 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebServices.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebServices.java @@ -510,9 +510,7 @@ public class NMWebServices { } } - throw new YarnException( - "Could not get detailed resource information for given resource-name=" - + resourceName); + return new NMResourceInfo(); } private long parseLongParam(String bytes) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js index b1b15189de1..aa5efbe0801 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js @@ -97,7 +97,9 @@ export default DS.Model.extend({ var used = 0; var ri; - var resourceInformations = this.get("usedResource").resourcesInformations; + const usedResource = this.get("usedResource"); + const availableResource = this.get("availableResource"); + var resourceInformations = usedResource ? usedResource.resourcesInformations : []; for (var i = 0; i < resourceInformations.length; i++) { ri = resourceInformations[i]; if (ri.name === "yarn.io/gpu") { @@ -106,7 +108,7 @@ export default DS.Model.extend({ } var available = 0; - resourceInformations = this.get("availableResource").resourcesInformations; + resourceInformations = availableResource ? availableResource.resourcesInformations : []; for (i = 0; i < resourceInformations.length; i++) { ri = resourceInformations[i]; if (ri.name === "yarn.io/gpu") { 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 index fffae30ab30..966e408d2cf 100644 --- 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 @@ -36,7 +36,7 @@ {{#link-to 'yarn-node-containers' nodeId nodeAddr}}List of Containers {{/link-to}} {{/link-to}} - {{#if nmGpuInfo}} + {{#if (and nmGpuInfo nmGpuInfo.info.totalGpuDevices)}} {{#link-to 'yarn-node.yarn-nm-gpu' tagName="li"}} {{#link-to 'yarn-node.yarn-nm-gpu' nodeId nodeAddr }}GPU Information {{/link-to}} 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 52f0c86c8e8..919e54df545 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 @@ -20,7 +20,7 @@