|
@@ -189,11 +189,33 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
|
|
|
property.set('displayType', siteProperty.displayType);
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ this.tweakConfigProperty(property);
|
|
|
+ },this);
|
|
|
|
|
|
return configProperties;
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * Function to override kerberos descriptor's property values
|
|
|
+ */
|
|
|
+ tweakConfigProperty: function(config) {
|
|
|
+ if (config.name === 'templeton.hive.properties') {
|
|
|
+ var defaultHiveMsPort = "9083";
|
|
|
+ var hiveMSHosts = App.HostComponent.find().filterProperty('componentName', 'HIVE_METASTORE');
|
|
|
+ if (hiveMSHosts.length > 1) {
|
|
|
+ var hiveMSHostNames = hiveMSHosts.mapProperty('hostName');
|
|
|
+ var port = config.value.match(/:[0-9]{2,4}/);
|
|
|
+ port = port ? port[0].slice(1) : defaultHiveMsPort;
|
|
|
+ for (var i = 0; i < hiveMSHostNames.length; i++) {
|
|
|
+ hiveMSHostNames[i] = "thrift://" + hiveMSHostNames[i] + ":" + port;
|
|
|
+ }
|
|
|
+ var configValue = config.value.replace(/thrift.+[0-9]{2,},/i, hiveMSHostNames.join('\\,') + ",");
|
|
|
+ config.set('value', configValue);
|
|
|
+ config.set('defaultValue', configValue);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* Sync up values between inherited property and its reference.
|
|
|
*
|