Quellcode durchsuchen

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

Alex Antonenko vor 10 Jahren
Ursprung
Commit
01d898529e
1 geänderte Dateien mit 24 neuen und 9 gelöschten Zeilen
  1. 24 9
      ambari-web/app/controllers/main/host/details.js

+ 24 - 9
ambari-web/app/controllers/main/host/details.js

@@ -538,17 +538,34 @@ 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
@@ -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;
   },