浏览代码

AMBARI-14116. hadoop.proxyuser.hcat.hosts contains only 2 of 3 WebHcat hosts (onechiporenko)

Oleg Nechiporenko 9 年之前
父节点
当前提交
61abd869b6

+ 3 - 0
ambari-web/app/controllers/main/host/details.js

@@ -955,9 +955,12 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
   getHiveHosts: function () {
   getHiveHosts: function () {
     var
     var
       hiveHosts = App.HostComponent.find().filterProperty('componentName', 'HIVE_METASTORE').mapProperty('hostName'),
       hiveHosts = App.HostComponent.find().filterProperty('componentName', 'HIVE_METASTORE').mapProperty('hostName'),
+      webhcatHosts = App.HostComponent.find().filterProperty('componentName', 'WEBHCAT_SERVER').mapProperty('hostName'),
       hiveMetastoreHost = this.get('hiveMetastoreHost'),
       hiveMetastoreHost = this.get('hiveMetastoreHost'),
       webhcatServerHost = this.get('webhcatServerHost');
       webhcatServerHost = this.get('webhcatServerHost');
 
 
+    hiveHosts = hiveHosts.concat(webhcatHosts).uniq();
+
     if (!!hiveMetastoreHost) {
     if (!!hiveMetastoreHost) {
       hiveHosts.push(hiveMetastoreHost);
       hiveHosts.push(hiveMetastoreHost);
       this.set('hiveMetastoreHost', '');
       this.set('hiveMetastoreHost', '');

+ 6 - 6
ambari-web/test/controllers/main/host/details_test.js

@@ -2981,7 +2981,7 @@ describe('App.MainHostDetailsController', function () {
           'deleteHiveMetaStore': false,
           'deleteHiveMetaStore': false,
           'deleteWebHCatServer': false
           'deleteWebHCatServer': false
         },
         },
-        'hiveHosts': ['h1', 'h2'],
+        'hiveHosts': ['h1', 'h2', 'h4'],
         'title': 'adding HiveServer2'
         'title': 'adding HiveServer2'
       },
       },
       {
       {
@@ -2991,7 +2991,7 @@ describe('App.MainHostDetailsController', function () {
           'deleteHiveMetaStore': false,
           'deleteHiveMetaStore': false,
           'deleteWebHCatServer': false
           'deleteWebHCatServer': false
         },
         },
-        'hiveHosts': ['h0', 'h1', 'h2'],
+        'hiveHosts': ['h0', 'h1', 'h2', 'h4'],
         'title': 'adding Hive Metastore'
         'title': 'adding Hive Metastore'
       },
       },
       {
       {
@@ -3001,7 +3001,7 @@ describe('App.MainHostDetailsController', function () {
           'deleteHiveMetaStore': false,
           'deleteHiveMetaStore': false,
           'deleteWebHCatServer': false
           'deleteWebHCatServer': false
         },
         },
-        'hiveHosts': ['h0', 'h1', 'h2'],
+        'hiveHosts': ['h0', 'h1', 'h2', 'h4'],
         'title': 'adding WebHCat Server'
         'title': 'adding WebHCat Server'
       },
       },
       {
       {
@@ -3012,7 +3012,7 @@ describe('App.MainHostDetailsController', function () {
           'deleteHiveMetaStore': true,
           'deleteHiveMetaStore': true,
           'deleteWebHCatServer': false
           'deleteWebHCatServer': false
         },
         },
-        'hiveHosts': ['h2'],
+        'hiveHosts': ['h2', 'h4'],
         'title': 'deleting Hive component'
         'title': 'deleting Hive component'
       },
       },
       {
       {
@@ -3034,7 +3034,7 @@ describe('App.MainHostDetailsController', function () {
           'deleteHiveMetaStore': false,
           'deleteHiveMetaStore': false,
           'deleteWebHCatServer': false
           'deleteWebHCatServer': false
         },
         },
-        'hiveHosts': ['h1'],
+        'hiveHosts': ['h1', 'h4'],
         'title': 'deleting host with Hive component'
         'title': 'deleting host with Hive component'
       },
       },
       {
       {
@@ -3045,7 +3045,7 @@ describe('App.MainHostDetailsController', function () {
           'deleteHiveMetaStore': false,
           'deleteHiveMetaStore': false,
           'deleteWebHCatServer': false
           'deleteWebHCatServer': false
         },
         },
-        'hiveHosts': ['h1'],
+        'hiveHosts': ['h1', 'h4'],
         'title': 'deleting host with WebHCat Server'
         'title': 'deleting host with WebHCat Server'
       }
       }
     ];
     ];