Переглянути джерело

AMBARI-7972 Remove "required value" for hive.zookeeper.quorum property in hive-site. (atkach)

atkach 10 роки тому
батько
коміт
2115609432

+ 3 - 1
ambari-web/app/controllers/main/service/add_controller.js

@@ -135,12 +135,14 @@ App.AddServiceController = App.WizardController.extend({
     var installedComponents = App.HostComponent.find();
 
     obj.forEach(function (_component) {
+      var installedComponent = installedComponents.findProperty('componentName', _component.component_name);
       masterComponentHosts.push({
         display_name: _component.display_name,
         component: _component.component_name,
         hostName: _component.selectedHost,
         serviceId: _component.serviceId,
-        isInstalled: installedComponents.someProperty('componentName', _component.component_name)
+        isInstalled: !!installedComponent,
+        workStatus: installedComponent && installedComponent.get('workStatus')
       });
     });
 

+ 1 - 0
ambari-web/app/data/HDP2.2/site_properties.js

@@ -43,6 +43,7 @@ hdp22properties.push(
     "displayName": "hive.zookeeper.quorum",
     "defaultValue": "localhost:2181",
     "displayType": "multiLine",
+    "isRequired": false,
     "isVisible": true,
     "serviceName": "HIVE",
     "category": "Advanced hive-site"

+ 6 - 0
ambari-web/app/models/service_config.js

@@ -498,6 +498,12 @@ App.ServiceConfigProperty = Ember.Object.extend({
       case 'hadoop.registry.zk.quorum':
       case 'hive.cluster.delegation.token.store.zookeeper.connectString':
         var zkHosts = masterComponentHostsInDB.filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
+        if (this.get('name') === 'hive.zookeeper.quorum') {
+          zkHosts = masterComponentHostsInDB.
+            filterProperty('component', 'ZOOKEEPER_SERVER').
+            filterProperty('workStatus', 'STARTED').
+            mapProperty('hostName');
+        }
         var zkHostPort = zkHosts;
         var regex = "\\w*:(\\d+)";   //regex to fetch the port
         var portValue = this.get('defaultValue').match(new RegExp(regex));