Prechádzať zdrojové kódy

AMBARI-5213. HCat client configs can be refreshed only on host/component level, but not on service level. (srimanth)

Srimanth Gunturi 11 rokov pred
rodič
commit
4275c3c742

+ 12 - 0
ambari-web/app/models/service.js

@@ -105,6 +105,18 @@ App.Service = DS.Model.extend({
    */
   isRestartRequired: function () {
     var rhc = this.get('hostComponents').filterProperty('staleConfigs', true);
+
+    // HCatalog components are technically owned by Hive.
+    if (this.get('serviceName') == 'HIVE') {
+      var hcatService = App.Service.find('HCATALOG');
+      if (hcatService != null && hcatService.get('isLoaded')) {
+        var hcatStaleHcs = hcatService.get('hostComponents').filterProperty('staleConfigs', true);
+        if (hcatStaleHcs != null) {
+          rhc.pushObjects(hcatStaleHcs);
+        }
+      }
+    }
+
     var hc = {};
     rhc.forEach(function(_rhc) {
       var hostName = _rhc.get('host.publicHostName');

+ 12 - 0
ambari-web/app/utils/batch_scheduled_requests.js

@@ -74,6 +74,18 @@ module.exports = {
     var context = staleConfigsOnly ? Em.I18n.t('rollingrestart.context.allWithStaleConfigsForSelectedService').format(serviceName) : Em.I18n.t('rollingrestart.context.allForSelectedService').format(serviceName);
     if (service) {
       var hostComponents = service.get('hostComponents').filterProperty('host.passiveState','OFF');
+
+      // HCatalog components are technically owned by Hive.
+      if (serviceName == 'HIVE') {
+        var hcatService = App.Service.find('HCATALOG');
+        if (hcatService != null && hcatService.get('isLoaded')) {
+          var hcatHcs = hcatService.get('hostComponents').filterProperty('host.passiveState', 'OFF');
+          if (hcatHcs != null) {
+            hostComponents.pushObjects(hcatHcs);
+          }
+        }
+      }
+
       if (staleConfigsOnly) {
         hostComponents = hostComponents.filterProperty('staleConfigs', true);
       }