This is an automated email from the ASF dual-hosted git repository. snemeth pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push: new 8f750c5 YARN-10856. Prevent ATS v2 health check REST API call if the ATS service itself is disabled. (#3236) 8f750c5 is described below commit 8f750c54aaa8b07e958b204b372f591f47cad2fa Author: Benjamin Teke <brumi1...@users.noreply.github.com> AuthorDate: Thu Jul 29 19:15:27 2021 +0200 YARN-10856. Prevent ATS v2 health check REST API call if the ATS service itself is disabled. (#3236) Co-authored-by: Benjamin Teke <bt...@cloudera.com> --- .../src/main/webapp/app/initializers/loader.js | 8 ++++++++ .../src/main/webapp/app/routes/application.js | 18 ++++++++++++------ .../src/main/webapp/app/routes/yarn-app/logs.js | 14 +++++++++----- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js index bf544ec..5a697ea 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js @@ -62,6 +62,10 @@ function getYarnHttpProtocolScheme(rmhost, application) { return getConfigFromYarn(rmhost, application, 'yarn.http.policy'); } +function getYarnTimelineEnabled(rmhost, application) { + return getConfigFromYarn(rmhost, application, 'yarn.timeline-service.enabled'); +} + function getTimeLineURL(rmhost, isHttpsSchemeEnabled) { var url = window.location.protocol + '//' + (ENV.hosts.localBaseAddress? ENV.hosts.localBaseAddress + '/' : '') + rmhost; @@ -192,6 +196,10 @@ function updateConfigs(application) { Ember.Logger.log("NodeMananger port: " + nodeManagerPort); ENV.nodeManagerPort = nodeManagerPort; + var timelineServiceEnabled = getYarnTimelineEnabled(rmhost, application); + Ember.Logger.log("Timeline Service enabled: " + timelineServiceEnabled); + ENV.timelineServiceEnabled = (timelineServiceEnabled.toLowerCase() === 'true'); + if (!ENV.hosts.jhsAddress) { var jhsAddress = getJHSURL(rmhost, application, isHttpsSchemeEnabled); jhsAddress = transformURL(jhsAddress, hostname); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js index 93631e0..7c3b311 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/application.js @@ -21,7 +21,7 @@ import AbstractRoute from './abstract'; export default AbstractRoute.extend({ model() { - return Ember.RSVP.hash({ + let promises = { clusterInfo: this.store.findAll('ClusterInfo', {reload: true}).catch(function() { return null; }), @@ -30,11 +30,15 @@ export default AbstractRoute.extend({ }), jhsHealth: this.store.queryRecord('jhs-health', {}).catch(function() { return null; - }), - timelineHealth: this.store.queryRecord('timeline-health', {}).catch(function() { - return null; }) - }); + }; + + if (ENV.timelineServiceEnabled) { + promises.timelineHealth = this.store.queryRecord('timeline-health', {}).catch(function() { + return null; + }); + } + return Ember.RSVP.hash(promises); }, actions: { @@ -62,7 +66,9 @@ export default AbstractRoute.extend({ unloadAll: function() { this.store.unloadAll('ClusterInfo'); this.store.unloadAll('cluster-user-info'); - this.store.unloadAll('timeline-health'); + if (ENV.timelineServiceEnabled) { + this.store.unloadAll('timeline-health'); + } this.store.unloadAll('jhs-health'); }, }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js index 55c52cd..888ab7c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-app/logs.js @@ -25,7 +25,7 @@ export default AbstractRoute.extend(AppAttemptMixin, { const { app_id } = this.paramsFor('yarn-app'); const { service } = param; transition.send('updateBreadcrumbs', app_id, service, [{text: 'Logs'}]); - return Ember.RSVP.hash({ + let promises = { appId: app_id, serviceName: service, attempts: this.fetchAttemptListFromRMorATS(app_id, this.store).catch(function() { @@ -36,11 +36,15 @@ export default AbstractRoute.extend(AppAttemptMixin, { Ember.Logger.log("jhs-health querying failed"); Ember.Logger.log(error); return null; - }), - timelineHealth: this.store.queryRecord('timeline-health', {}).catch(function() { - return null; }) - }); + }; + + if (ENV.timelineServiceEnabled) { + promises.timelineHealth = this.store.queryRecord('timeline-health', {}).catch(function() { + return null; + }); + } + return Ember.RSVP.hash(promises); }, activate() { --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org