From 50cec5a704d11ffc5e0333d22dbea7cf6837c2fc Mon Sep 17 00:00:00 2001 From: Sunil G Date: Sat, 10 Aug 2019 21:06:25 +0530 Subject: [PATCH] YARN-9729. [UI2] Fix error message for logs without ATSv2. Contributed by Zoltan Siegl. --- .../webapp/app/controllers/yarn-app/logs.js | 9 ++- .../main/webapp/app/routes/yarn-app/logs.js | 5 +- .../webapp/app/templates/yarn-app/logs.hbs | 79 +++++++++++-------- 3 files changed, 56 insertions(+), 37 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/logs.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/logs.js index e1a8ec8dc27..d7eac3ffd5b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/logs.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/logs.js @@ -263,5 +263,12 @@ export default Ember.Controller.extend({ isLogAggregationNotSucceeded: Ember.computed("model.app", function() { const logAggregationStatus = this.get("model.app.logAggregationStatus"); return logAggregationStatus !== "SUCCEEDED"; - }) + }), + + isTimelineUnHealthy: function() { + if (this.model && this.model.timelineHealth) { + return this.model.timelineHealth.get('isTimelineUnHealthy'); + } + return true; + }.property('model.timelineHealth') }); 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 b73bc80f175..9719f804f04 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 @@ -31,7 +31,10 @@ export default AbstractRoute.extend(AppAttemptMixin, { attempts: this.fetchAttemptListFromRMorATS(app_id, this.store).catch(function() { return []; }), - app: this.fetchAppInfoFromRMorATS(app_id, this.store) + app: this.fetchAppInfoFromRMorATS(app_id, this.store), + timelineHealth: this.store.queryRecord('timeline-health', {}).catch(function() { + return null; + }) }); }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/logs.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/logs.hbs index 10fd73ec940..72147b9af9c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/logs.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/logs.hbs @@ -32,43 +32,52 @@ Loading... {{/if}} - {{#if attemptList}} -
-
- -
- -
+ {{#if isTimelineUnHealthy}} +
+
+
+ Logs are unavailable because Application Timeline Service seems unhealthy. +
- {{#if attemptContainerList}} -
- -
- -
-
- {{else}} - {{#if (and selectedAttemptId (not _isLoadingTopPanel))}} -
-

No container data available!

-
- {{/if}} - {{/if}} -
{{else}} -
-

No data available!

-
+ {{#if attemptList}} +
+
+ +
+ +
+
+ {{#if attemptContainerList}} +
+ +
+ +
+
+ {{else}} + {{#if (and selectedAttemptId (not _isLoadingTopPanel))}} +
+

No container data available!

+
+ {{/if}} + {{/if}} +
+ {{else}} +
+

No data available!

+
+ {{/if}} {{/if}}