From a2752779ac1545f5e0a52fce3cff02a7007e95fb Mon Sep 17 00:00:00 2001 From: Sunil G Date: Fri, 21 Sep 2018 15:47:10 +0530 Subject: [PATCH] YARN-8628. [UI2] Few duplicated or inconsistent information displayed in UI2. Contributed by Akhil PB. --- .../src/main/webapp/app/controllers/yarn-app/components.js | 2 +- .../webapp/app/controllers/yarn-component-instance/info.js | 5 +++-- .../app/controllers/yarn-component-instances/info.js | 3 ++- .../main/webapp/app/routes/yarn-component-instance/info.js | 4 ++-- .../main/webapp/app/serializers/yarn-component-instance.js | 1 - .../src/main/webapp/app/serializers/yarn-container.js | 2 +- .../main/webapp/app/serializers/yarn-service-component.js | 2 +- .../main/webapp/app/serializers/yarn-timeline-container.js | 2 +- .../src/main/webapp/app/templates/yarn-app/configs.hbs | 7 ++++--- .../webapp/app/templates/yarn-component-instance/info.hbs | 4 ---- 10 files changed, 15 insertions(+), 17 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/components.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/components.js index 5981eb549ab..5a6c616caf0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/components.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/components.js @@ -41,7 +41,7 @@ export default Ember.Controller.extend({ getCellContent: function(row) { return { displayText: row.get('name'), - href: `#/yarn-component-instances/${row.get('name')}/info?service=${service}&&appid=${appId}` + href: `#/yarn-component-instances/${row.get('name')}/info?service=${service}&appid=${appId}` }; } }, { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instance/info.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instance/info.js index e3abcb7c6d7..e920aa2e104 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instance/info.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instance/info.js @@ -19,7 +19,8 @@ import Ember from 'ember'; export default Ember.Controller.extend({ - queryParams: ["appid", "service"], + queryParams: ["appid", "service", "containerid"], appid: undefined, - service: undefined + service: undefined, + containerid: undefined }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js index 44cfe1736b7..be4b4f37380 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-component-instances/info.js @@ -42,9 +42,10 @@ export default Ember.Controller.extend({ getCellContent: function(row) { var component = row.get('component'); var instance = row.get('instanceName'); + var containerId = row.get('containerId'); return { text: instance, - href: `#/yarn-component-instance/${component}/instances/${instance}/info?appid=${appId}&&service=${serviceName}` + href: `#/yarn-component-instance/${component}/instances/${instance}/info?appid=${appId}&service=${serviceName}&containerid=${containerId}` }; } }, { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-component-instance/info.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-component-instance/info.js index 3753c753e24..a67324abf22 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-component-instance/info.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-component-instance/info.js @@ -29,8 +29,8 @@ export default AbstractRoute.extend({ componentName: params.component_name, instanceName: instanceName, container: this.store.query('yarn-component-instance', {appId: params.appid}).then(function(instances) { - if (instances && instances.findBy('instanceName', instanceName)) { - return instances.findBy('instanceName', instanceName); + if (instances && instances.findBy('containerId', params.containerid)) { + return instances.findBy('containerId', params.containerid); } return null; }, function() { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-component-instance.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-component-instance.js index 1bd3b2ca1c3..ce0dfb03136 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-component-instance.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-component-instance.js @@ -34,7 +34,6 @@ export default DS.JSONAPISerializer.extend({ startedTimestamp: info.LAUNCH_TIME, host: info.HOSTNAME, node: info.BARE_HOST, - hostUrl: 'N/A', ipAddr: info.IP, exitStatusCode: info.EXIT_STATUS_CODE } 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 fc640c52e4e..f7f8272850a 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 @@ -34,7 +34,7 @@ export default DS.JSONAPISerializer.extend({ finishedTime: Converter.timeStampToDate(payload.finishedTime), elapsedTime: payload.elapsedTime, logUrl: payload.logUrl, - containerExitStatus: payload.containerExitStatus, + containerExitStatus: payload.containerExitStatus + '', containerState: payload.containerState, nodeId : payload.nodeId, nodeHttpAddress: payload.nodeHttpAddress diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-service-component.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-service-component.js index b0261fcd931..9dd7e6c4e90 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-service-component.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-service-component.js @@ -52,7 +52,7 @@ export default DS.JSONAPISerializer.extend({ vcores: info.RESOURCE_CPU, memory: info.RESOURCE_MEMORY, priority: 'N/A', - instances: 'N/A', + instances: '0', createdTimestamp: payload.createdtime, configs: newConfigs, metrics: newMetrics diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js index 99ab6c4f313..5b62b2f72d0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js @@ -34,7 +34,7 @@ export default DS.JSONAPISerializer.extend({ startedTime: Converter.timeStampToDate(payload.createdtime), finishedTime: Converter.timeStampToDate(payload.info.YARN_CONTAINER_FINISHED_TIME), nodeHttpAddress: payload.info.YARN_CONTAINER_ALLOCATED_HOST_HTTP_ADDRESS, - containerExitStatus: payload.info.YARN_CONTAINER_EXIT_STATUS, + containerExitStatus: payload.info.YARN_CONTAINER_EXIT_STATUS + '', containerState: payload.info.YARN_CONTAINER_STATE, nodeId: payload.info.YARN_CONTAINER_ALLOCATED_HOST + ':' + payload.info.YARN_CONTAINER_ALLOCATED_PORT, diagnosticsInfo: payload.info.YARN_CONTAINER_DIAGNOSTICS_INFO diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/configs.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/configs.hbs index 5f4d29d0bd2..daf9549260c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/configs.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/configs.hbs @@ -16,10 +16,11 @@ * limitations under the License. }} -
- {{metrics-table metrics=model.metrics type="Service"}} +
+
+ {{metrics-table metrics=model.metrics type="Service"}} +
- {{#if model.configs}}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs index 553f4e8d030..1b9d04aa7e3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-component-instance/info.hbs @@ -49,10 +49,6 @@ Host {{check-availability model.container.host}} - - Host URL - {{check-availability model.container.hostUrl}} - Node {{check-availability model.container.node}}