ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject git commit: AMBARI-6483. JS errors on Jobs page if ATS is stopped. (onechiporenko)
Date Tue, 15 Jul 2014 11:47:00 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk f3f4876f7 -> ff82ef366


AMBARI-6483. JS errors on Jobs page if ATS is stopped. (onechiporenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ff82ef36
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ff82ef36
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ff82ef36

Branch: refs/heads/trunk
Commit: ff82ef366439d0e036f5c8fc89df526c00780578
Parents: f3f4876
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Tue Jul 15 14:44:02 2014 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Tue Jul 15 14:44:02 2014 +0300

----------------------------------------------------------------------
 .../app/controllers/main/jobs_controller.js     | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ff82ef36/ambari-web/app/controllers/main/jobs_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/jobs_controller.js b/ambari-web/app/controllers/main/jobs_controller.js
index 3071dc5..caeac05 100644
--- a/ambari-web/app/controllers/main/jobs_controller.js
+++ b/ambari-web/app/controllers/main/jobs_controller.js
@@ -401,15 +401,17 @@ App.MainJobsController = Em.Controller.extend({
   },
 
   loadJobs : function() {
-    var self = this;
-    var timeout = this.get('loadTimeout');
-    var yarnService = App.YARNService.find().objectAt(0);
-    var retryLoad = this.checkDataLoadingError();
-    if (yarnService != null) {
+    var self = this,
+      timeout = this.get('loadTimeout'),
+      yarnService = App.YARNService.find().objectAt(0),
+      atsComponent = App.HostComponent.find().findProperty('componentName','APP_TIMELINE_SERVER'),
+      atsInValidState = !!atsComponent && atsComponent.get('workStatus') === "STARTED",
+      retryLoad = this.checkDataLoadingError();
+    if (yarnService != null && atsInValidState) {
       this.set('loading', true);
-      var historyServerHostName = yarnService.get('appTimelineServer.hostName');
-      var filtersLink = this.get('filterObject').createJobsFiltersLink();
-      var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-queries.json" : "/proxy?url=http://"
+ historyServerHostName
+      var historyServerHostName = yarnService.get('appTimelineServer.hostName'),
+        filtersLink = this.get('filterObject').createJobsFiltersLink(),
+        hiveQueriesUrl = App.get('testMode') ? "/data/jobs/hive-queries.json" : "/proxy?url=http://"
+ historyServerHostName
         + ":" + yarnService.get('ahsWebPort') + "/ws/v1/timeline/HIVE_QUERY_ID" + filtersLink;
       App.ajax.send({
         name: 'jobs.lastID',
@@ -420,7 +422,7 @@ App.MainJobsController = Em.Controller.extend({
         },
         success: 'lastIDSuccessCallback',
         error : 'lastIDErrorCallback'
-      }),
+      });
       App.HttpClient.get(hiveQueriesUrl, App.hiveJobsMapper, {
         complete : function(data, jqXHR, textStatus) {
           self.set('loading', false);
@@ -435,6 +437,7 @@ App.MainJobsController = Em.Controller.extend({
         self.checkDataLoadingError(jqXHR);
       });
     }else{
+      this.checkDataLoadingError();
       clearTimeout(timeout);
       timeout = setTimeout(function(){
         self.loadJobs();


Mime
View raw message