Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs (revision 64f30da42813182e9cf69ec306c1f1c0c633ece0) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs (date 1558100753000) @@ -56,7 +56,7 @@ (current) {{/link-to}} {{/link-to}} - {{#link-to 'yarn-flow-activity' tagName="li"}} + {{#link-to 'yarn-flow-activity' tagName="li" disabled=flowPageDisabled }} {{#link-to 'yarn-flow-activity' class="navigation-link"}}Flow Activity (current) {{/link-to}} Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js (revision 64f30da42813182e9cf69ec306c1f1c0c633ece0) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js (date 1558019753000) @@ -73,4 +73,8 @@ } return null; }.property('model.userInfo'), -}); + + flowPageDisabled: Ember.computed(function() { + return this.get("env.app.atsV2HealthStatus") !== "OK"; + }) +}); \ No newline at end of file Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js (revision 64f30da42813182e9cf69ec306c1f1c0c633ece0) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js (date 1558085948000) @@ -134,6 +134,38 @@ return port; } +function getTimlineV2HealthStatus(timelineWebAddress, application) { + var httpUrl = window.location.protocol + '//' + + (ENV.hosts.localBaseAddress? ENV.hosts.localBaseAddress + '/' : '') + timelineWebAddress; + + httpUrl += '/ws/v2/timeline/health'; + Ember.Logger.log("ATSv2 HealthStatus URL: " + httpUrl); + + var healthStatus = ""; + $.ajax({ + type: 'GET', + dataType: 'json', + async: false, + context: this, + url: httpUrl, + success: function(data) { + healthStatus = data.healthStatus; + application.advanceReadiness(); + }, + error: function(response) { + try { + var data = JSON.parse(response.responseText); + healthStatus = data.healthStatus || "BAD"; + } catch (exception) { + healthStatus = "BAD"; + } + + application.advanceReadiness(); + } + }); + return healthStatus; +} + function updateConfigs(application) { var hostname = window.location.hostname; var rmhost = hostname + (window.location.port ? ':' + window.location.port: '') + @@ -196,6 +228,10 @@ application.advanceReadiness(); } + var atsV2HealthStatus = getTimlineV2HealthStatus(ENV.hosts.timelineWebAddress, application); + Ember.Logger.log("ATSv2 HealthStatus: " + atsV2HealthStatus); + ENV.atsV2HealthStatus = atsV2HealthStatus; + if(!ENV.hosts.timelineV1WebAddress) { var timelinehost = ""; $.ajax({