Repository: ambari
Updated Branches:
  refs/heads/trunk 23590a3b4 -> 01d898529


AMBARI-8680. Incorrect hive.metastore.uris value after adding Hive Metastore 
via Service Actions (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 01d898529e5f2cf33fd4ba14b1839eb7043c133b
Parents: 23590a3
Author: Alex Antonenko <hiv...@gmail.com>
Authored: Fri Dec 12 11:36:31 2014 +0200
Committer: Alex Antonenko <hiv...@gmail.com>
Committed: Fri Dec 12 12:44:23 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js | 33 ++++++++++++++------
 1 file changed, 24 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/01d89852/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js 
b/ambari-web/app/controllers/main/host/details.js
index 857fe72..4a49cfe 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -538,18 +538,35 @@ App.MainHostDetailsController = Em.Controller.extend({
     }
 
     this.showBackgroundOperationsPopup(function () {
-      if (params.componentName === 'ZOOKEEPER_SERVER') {
-        self.set('zkRequestId', data.Requests.id);
-        
self.addObserver('App.router.backgroundOperationsController.serviceTimestamp', 
self, self.checkZkConfigs);
-        self.checkZkConfigs();
-      }else if (params.componentName === 'HIVE_METASTORE'){
-       self.loadConfigs('loadHiveConfigs');
+      if (params.componentName === 'ZOOKEEPER_SERVER' || params.componentName 
=== 'HIVE_METASTORE') {
+        self.set(params.componentName === 'ZOOKEEPER_SERVER' ? 'zkRequestId' : 
'hiveRequestId', data.Requests.id);
+        self.addObserver(
+          'App.router.backgroundOperationsController.serviceTimestamp',
+          self,
+          (params.componentName === 'ZOOKEEPER_SERVER' ? self.checkZkConfigs : 
self.checkHiveDone)
+          );
+        params.componentName === 'ZOOKEEPER_SERVER' ? self.checkZkConfigs() : 
self.checkHiveDone();
       }
     });
     return true;
   },
 
   /**
+   * Call load tags
+   * @method checkHiveDone
+   */
+  checkHiveDone: function () {
+    var bg = 
App.router.get('backgroundOperationsController.services').findProperty('id', 
this.get('hiveRequestId'));
+    if (bg && !bg.get('isRunning')) {
+      var self = this;
+      
this.removeObserver('App.router.backgroundOperationsController.serviceTimestamp',
 this, this.checkHiveDone);
+      setTimeout(function () {
+        self.loadConfigs("loadHiveConfigs");
+      }, App.get('componentsUpdateInterval'));
+    }
+  },
+
+  /**
    * Success callback for load configs request
    * @param {object} data
    * @method loadHiveConfigs
@@ -599,9 +616,7 @@ App.MainHostDetailsController = Em.Controller.extend({
     if (this.get('fromDeleteHost') || this.get('deleteHiveMetaStore')) {
       this.set('deleteHiveMetaStore', false);
       this.set('fromDeleteHost', false);
-      hiveHosts = hiveHosts.without(this.get('content.hostName'));
-    } else if (!hiveHosts.contains(this.get('content.hostName'))) {
-      hiveHosts.push(this.get('content.hostName'));
+      return hiveHosts.without(this.get('content.hostName'));
     }
     return hiveHosts;
   },

Reply via email to