You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2019/06/12 13:58:57 UTC
[hadoop] branch branch-3.1 updated: YARN-9543. [UI2] Handle ATSv2
server down or failures cases gracefully in YARN UI v2. Contributed by
Zoltan Siegl and Akhil P B.
This is an automated email from the ASF dual-hosted git repository.
sunilg pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new c343554 YARN-9543. [UI2] Handle ATSv2 server down or failures cases gracefully in YARN UI v2. Contributed by Zoltan Siegl and Akhil P B.
c343554 is described below
commit c343554e2ae9c4c44178a17c0843cd83425c8b0f
Author: Sunil G <su...@apache.org>
AuthorDate: Fri May 31 12:29:44 2019 +0530
YARN-9543. [UI2] Handle ATSv2 server down or failures cases gracefully in YARN UI v2. Contributed by Zoltan Siegl and Akhil P B.
(cherry picked from commit 52128e352a30b70b83483f9290d9e94e98929705)
---
.../hadoop-yarn-ui/src/main/webapp/.gitignore | 4 ++++
.../timeline-error.js => adapters/timeline-health.js} | 19 ++++++++++---------
.../src/main/webapp/app/controllers/application.js | 7 +++++++
.../timeline-error.js => models/timeline-health.js} | 16 +++++++---------
.../src/main/webapp/app/routes/application.js | 4 ++++
.../src/main/webapp/app/routes/timeline-error.js | 3 +++
.../timeline-health.js} | 18 ++++++++++--------
.../src/main/webapp/app/templates/application.hbs | 4 ++--
8 files changed, 47 insertions(+), 28 deletions(-)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/.gitignore b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/.gitignore
new file mode 100644
index 0000000..338997f
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/.gitignore
@@ -0,0 +1,4 @@
+tmp/
+node_modules/
+bower_components/
+dist/
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/timeline-health.js
similarity index 73%
copy from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
copy to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/timeline-health.js
index c2e5fc5..8ca2310 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/timeline-health.js
@@ -16,14 +16,15 @@
* limitations under the License.
*/
-import Ember from 'ember';
+import RESTAbstractAdapter from './restabstract';
-export default Ember.Route.extend({
- afterModel(model/*, transition*/) {
- model.error_id = "error";
- model.isValidErrorCode = false;
- if (model.errorCode && model.errorCode !== "0") {
- model.isValidErrorCode = true;
- }
+export default RESTAbstractAdapter.extend({
+ address: "timelineWebAddress",
+ restNameSpace: "timelineV2",
+ serverName: "ATS",
+
+ urlForQueryRecord(/*query, modelName*/) {
+ var url = this.buildURL();
+ return url + '/health';
}
-});
+});
\ No newline at end of file
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js
index 50a2909..34702ac 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/application.js
@@ -73,4 +73,11 @@ export default Ember.Controller.extend({
}
return null;
}.property('model.userInfo'),
+
+ 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/timeline-error.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/timeline-health.js
similarity index 75%
copy from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
copy to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/timeline-health.js
index c2e5fc5..367ab07 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/timeline-health.js
@@ -16,14 +16,12 @@
* limitations under the License.
*/
-import Ember from 'ember';
+import DS from 'ember-data';
-export default Ember.Route.extend({
- afterModel(model/*, transition*/) {
- model.error_id = "error";
- model.isValidErrorCode = false;
- if (model.errorCode && model.errorCode !== "0") {
- model.isValidErrorCode = true;
- }
- }
+export default DS.Model.extend({
+ healthStatus: DS.attr('string'),
+
+ isTimelineUnHealthy: function() {
+ return this.get('healthStatus') !== 'RUNNING';
+ }.property('healthStatus')
});
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 adb57b1..ead17e1 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
@@ -27,6 +27,9 @@ export default AbstractRoute.extend({
}),
userInfo: this.store.findAll('cluster-user-info', {reload: true}).catch(function() {
return null;
+ }),
+ timelineHealth: this.store.queryRecord('timeline-health', {}).catch(function() {
+ return null;
})
});
},
@@ -56,5 +59,6 @@ export default AbstractRoute.extend({
unloadAll: function() {
this.store.unloadAll('ClusterInfo');
this.store.unloadAll('cluster-user-info');
+ this.store.unloadAll('timeline-health');
},
});
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
index c2e5fc5..54fc8d4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
@@ -19,6 +19,9 @@
import Ember from 'ember';
export default Ember.Route.extend({
+ model() {
+ return {};
+ },
afterModel(model/*, transition*/) {
model.error_id = "error";
model.isValidErrorCode = false;
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/timeline-health.js
similarity index 73%
copy from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
copy to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/timeline-health.js
index c2e5fc5..79fb461 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/timeline-error.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/timeline-health.js
@@ -16,14 +16,16 @@
* limitations under the License.
*/
-import Ember from 'ember';
+import DS from 'ember-data';
-export default Ember.Route.extend({
- afterModel(model/*, transition*/) {
- model.error_id = "error";
- model.isValidErrorCode = false;
- if (model.errorCode && model.errorCode !== "0") {
- model.isValidErrorCode = true;
- }
+export default DS.JSONAPISerializer.extend({
+ normalizeSingleResponse(store, primaryModelClass, payload) {
+ var fixedPayload = {
+ id: Date.now(),
+ type: primaryModelClass.modelName,
+ attributes: payload
+ };
+
+ return { data: fixedPayload };
}
});
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs
index ecb1481..1d469d9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/application.hbs
@@ -56,8 +56,8 @@
<span class="sr-only">(current)</span>
{{/link-to}}
{{/link-to}}
- {{#link-to 'yarn-flow-activity' tagName="li"}}
- {{#link-to 'yarn-flow-activity' class="navigation-link"}}Flow Activity
+ {{#link-to 'yarn-flow-activity' tagName="li" disabled=isTimelineUnHealthy}}
+ {{#link-to 'yarn-flow-activity' class="navigation-link" disabled=isTimelineUnHealthy}}Flow Activity
<span class="sr-only">(current)</span>
{{/link-to}}
{{/link-to}}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org