summaryrefslogtreecommitdiff
path: root/ambari-web/app/views/wizard/controls_view.js
diff options
context:
space:
mode:
Diffstat (limited to 'ambari-web/app/views/wizard/controls_view.js')
-rw-r--r--ambari-web/app/views/wizard/controls_view.js102
1 files changed, 96 insertions, 6 deletions
diff --git a/ambari-web/app/views/wizard/controls_view.js b/ambari-web/app/views/wizard/controls_view.js
index b4e70cb6d3..a4cbf3fdfd 100644
--- a/ambari-web/app/views/wizard/controls_view.js
+++ b/ambari-web/app/views/wizard/controls_view.js
@@ -255,7 +255,24 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName'));
dbClass.set('value', "oracle.jdbc.driver.OracleDriver");
break;
+ case 'Existing MSSQL Server database with integrated authentication':
+ connectionUrl.set('value', "jdbc:sqlserver://" + this.get('hostName') + ";databaseName=" + this.get('databaseName') + ";integratedSecurity=true");
+ dbClass.set('value', "com.microsoft.sqlserver.jdbc.SQLServerDriver");
+ break;
+ case 'Existing MSSQL Server database with sql auth':
+ connectionUrl.set('value', "jdbc:sqlserver://" + this.get('hostName') + ";databaseName=" + this.get('databaseName'));
+ dbClass.set('value', "com.microsoft.sqlserver.jdbc.SQLServerDriver");
+ break;
}
+ var isNotExistingMySQLServer = this.get('serviceConfig.value') !== 'Existing MSSQL Server database with integrated authentication';
+ this.get('categoryConfigsAll').findProperty('name', 'javax.jdo.option.ConnectionUserName').setProperties({
+ isVisible: isNotExistingMySQLServer,
+ isRequired: isNotExistingMySQLServer
+ });
+ this.get('categoryConfigsAll').findProperty('name', 'javax.jdo.option.ConnectionPassword').setProperties({
+ isVisible: isNotExistingMySQLServer,
+ isRequired: isNotExistingMySQLServer
+ });
} else if (this.get('serviceConfig.serviceName') === 'OOZIE') {
switch (this.get('serviceConfig.value')) {
case 'New Derby Database':
@@ -274,7 +291,44 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
connectionUrl.set('value', "jdbc:oracle:thin:@//" + this.get('hostName') + ":1521/" + this.get('databaseName'));
dbClass.set('value', "oracle.jdbc.driver.OracleDriver");
break;
+ case 'Existing MSSQL Server database with integrated authentication':
+ connectionUrl.set('value', "jdbc:sqlserver://" + this.get('hostName') + ";databaseName=" + this.get('databaseName') + ";integratedSecurity=true");
+ dbClass.set('value', "com.microsoft.sqlserver.jdbc.SQLServerDriver");
+ break;
+ case 'Existing MSSQL Server database with sql auth':
+ connectionUrl.set('value', "jdbc:sqlserver://" + this.get('hostName') + ";databaseName=" + this.get('databaseName'));
+ dbClass.set('value', "com.microsoft.sqlserver.jdbc.SQLServerDriver");
+ break;
+ }
+ isNotExistingMySQLServer = this.get('serviceConfig.value') !== 'Existing MSSQL Server database with integrated authentication';
+ this.get('categoryConfigsAll').findProperty('name', 'oozie.service.JPAService.jdbc.username').setProperties({
+ isVisible: isNotExistingMySQLServer,
+ isRequired: isNotExistingMySQLServer
+ });
+ this.get('categoryConfigsAll').findProperty('name', 'oozie.service.JPAService.jdbc.password').setProperties({
+ isVisible: isNotExistingMySQLServer,
+ isRequired: isNotExistingMySQLServer
+ });
+ } else if (this.get('serviceConfig.serviceName') === 'HDFS') {
+ switch (this.get('serviceConfig.value')) {
+ case 'Existing MSSQL Server database with integrated authentication':
+ connectionUrl.set('value', "jdbc:sqlserver://" + this.get('hostName') + ";databaseName=" + this.get('databaseName') + ";integratedSecurity=true");
+ dbClass.set('value', "com.microsoft.sqlserver.jdbc.SQLServerDriver");
+ break;
+ case 'Existing MSSQL Server database with sql auth':
+ connectionUrl.set('value', "jdbc:sqlserver://" + this.get('hostName') + ";databaseName=" + this.get('databaseName'));
+ dbClass.set('value', "com.microsoft.sqlserver.jdbc.SQLServerDriver");
+ break;
}
+ var isNotExistingMySQLServer = this.get('serviceConfig.value') !== 'Existing MSSQL Server database with integrated authentication';
+ this.get('categoryConfigsAll').findProperty('name', 'sink.dblogin').setProperties({
+ isVisible: isNotExistingMySQLServer,
+ isRequired: isNotExistingMySQLServer
+ });
+ this.get('categoryConfigsAll').findProperty('name', 'sink.dbpassword').setProperties({
+ isVisible: isNotExistingMySQLServer,
+ isRequired: isNotExistingMySQLServer
+ });
}
connectionUrl.set('defaultValue', connectionUrl.get('value'));
}
@@ -287,6 +341,8 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
switch (this.get('serviceConfig.serviceName')) {
case 'HIVE':
return this.get('categoryConfigsAll').findProperty('name', 'ambari.hive.db.schema.name').get('value');
+ case 'HDFS':
+ return this.get('categoryConfigsAll').findProperty('name', 'sink.db.schema.name').get('value');
case 'OOZIE':
return this.get('categoryConfigsAll').findProperty('name', 'oozie.db.schema.name').get('value');
default:
@@ -314,13 +370,32 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
case 'Existing Oracle Database':
hostname = this.get('categoryConfigsAll').findProperty('name', 'hive_existing_oracle_host');
break;
+ case 'Existing MSSQL Server database with integrated authentication':
+ hostname = this.get('categoryConfigsAll').findProperty('name', 'hive_existing_mssql_server_host');
+ break;
+ case 'Existing MSSQL Server database with sql auth':
+ hostname = this.get('categoryConfigsAll').findProperty('name', 'hive_existing_mssql_server_2_host');
+ break;
}
if (hostname) {
returnValue = hostname.get('value');
} else {
returnValue = this.get('categoryConfigsAll').findProperty('name', 'hive_hostname').get('value');
}
-
+ } else if (this.get('serviceConfig.serviceName') === 'HDFS') {
+ switch (value) {
+ case 'Existing MSSQL Server database with integrated authentication':
+ hostname = this.get('categoryConfigsAll').findProperty('name', 'sink_existing_mssql_server_host');
+ break;
+ case 'Existing MSSQL Server database with sql auth':
+ hostname = this.get('categoryConfigsAll').findProperty('name', 'sink_existing_mssql_server_2_host');
+ break;
+ }
+ if (hostname) {
+ returnValue = hostname.get('value');
+ } else {
+ returnValue = this.get('categoryConfigsAll').findProperty('name', 'sink.dbservername').get('value');
+ }
} else if (this.get('serviceConfig.serviceName') === 'OOZIE') {
switch (value) {
case 'New Derby Database':
@@ -335,6 +410,12 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
case 'Existing Oracle Database':
hostname = this.get('categoryConfigsAll').findProperty('name', 'oozie_existing_oracle_host');
break;
+ case 'Existing MSSQL Server database with integrated authentication':
+ hostname = this.get('categoryConfigsAll').findProperty('name', 'oozie_existing_mssql_server_host');
+ break;
+ case 'Existing MSSQL Server database with sql auth':
+ hostname = this.get('categoryConfigsAll').findProperty('name', 'oozie_existing_mssql_server_2_host');
+ break;
}
if (hostname) {
returnValue = hostname.get('value');
@@ -348,6 +429,8 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
connectionUrl: function () {
if (this.get('serviceConfig.serviceName') === 'HIVE') {
return this.get('categoryConfigsAll').findProperty('name', 'javax.jdo.option.ConnectionURL');
+ } else if (this.get('serviceConfig.serviceName') === 'HDFS') {
+ return this.get('categoryConfigsAll').findProperty('name', 'sink.jdbc.url');
} else {
return this.get('categoryConfigsAll').findProperty('name', 'oozie.service.JPAService.jdbc.url');
}
@@ -356,6 +439,8 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
dbClass: function () {
if (this.get('serviceConfig.serviceName') === 'HIVE') {
return this.get('categoryConfigsAll').findProperty('name', 'javax.jdo.option.ConnectionDriverName');
+ } else if (this.get('serviceConfig.serviceName') === 'HDFS') {
+ return this.get('categoryConfigsAll').findProperty('name', 'sink.jdbc.driver');
} else {
return this.get('categoryConfigsAll').findProperty('name', 'oozie.service.JPAService.jdbc.driver');
}
@@ -371,11 +456,11 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
**/
handleDBConnectionProperty: function () {
if (!['addServiceController', 'installerController'].contains(App.clusterStatus.wizardControllerName)) return;
- var handledProperties = ['oozie_database', 'hive_database'];
+ var handledProperties = ['oozie_database', 'hive_database', 'sink_database'];
var currentValue = this.get('serviceConfig.value');
- var databases = /MySQL|PostgreSQL|Oracle|Derby/gi;
+ var databases = /MySQL|PostgreSQL|Oracle|Derby|MSSQL/gi;
var currentDB = currentValue.match(databases)[0];
- var databasesTypes = /MySQL|PostgreS|Oracle|Derby/gi;
+ var databasesTypes = /MySQL|PostgreS|Oracle|Derby|MSSQL/gi;
var currentDBType = currentValue.match(databasesTypes)[0];
var existingDatabase = /existing/gi.test(currentValue);
// db connection check button show up if existed db selected
@@ -392,6 +477,7 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
// warning msg under database type radio buttons, to warn the user to setup jdbc driver if existed db selected
var propertyHive = this.get('categoryConfigsAll').findProperty('displayName', 'Hive Database');
var propertyOozie = this.get('categoryConfigsAll').findProperty('displayName', 'Oozie Database');
+ var propertyMetricsSink = this.get('categoryConfigsAll').findProperty('displayName', 'Metrics Sink Database');
var propertyAppendTo2 = propertyHive ? propertyHive : propertyOozie;
if (currentDB && existingDatabase) {
if (handledProperties.contains(this.get('serviceConfig.name'))) {
@@ -775,6 +861,8 @@ App.CheckDBConnectionView = Ember.View.extend({
hostNameProperty: function() {
if (!/wizard/i.test(this.get('controller.name')) && this.get('parentView.service.serviceName') === 'HIVE') {
return this.get('parentView.service.serviceName').toLowerCase() + '_hostname';
+ } else if (!/wizard/i.test(this.get('controller.name')) && this.get('parentView.service.serviceName') === 'HDFS') {
+ return 'sink.dbservername';
}
return '{0}_existing_{1}_host'.format(this.get('parentView.service.serviceName').toLowerCase(), this.get('databaseName').toLowerCase());
}.property('databaseName'),
@@ -785,6 +873,7 @@ App.CheckDBConnectionView = Ember.View.extend({
/** @property {object} requiredProperties - properties that necessary for database connection **/
requiredProperties: function() {
var propertiesMap = {
+ HDFS: ['sink.db.schema.name','sink.dblogin','sink.dbpassword','sink.jdbc.driver','sink.jdbc.url'],
OOZIE: ['oozie.db.schema.name','oozie.service.JPAService.jdbc.username','oozie.service.JPAService.jdbc.password','oozie.service.JPAService.jdbc.driver','oozie.service.JPAService.jdbc.url'],
HIVE: ['ambari.hive.db.schema.name','javax.jdo.option.ConnectionUserName','javax.jdo.option.ConnectionPassword','javax.jdo.option.ConnectionDriverName','javax.jdo.option.ConnectionURL']
};
@@ -793,8 +882,8 @@ App.CheckDBConnectionView = Ember.View.extend({
/** @property {Object} propertiesPattern - check pattern according to type of connection properties **/
propertiesPattern: function() {
return {
- user_name: /username$/ig,
- user_passwd: /password$/ig,
+ user_name: /(username|dblogin)$/ig,
+ user_passwd: /(dbpassword|password)$/ig,
db_connection_url: /jdbc\.url|connectionurl/ig
}
}.property(),
@@ -802,6 +891,7 @@ App.CheckDBConnectionView = Ember.View.extend({
masterHostName: function() {
var serviceMasterMap = {
'OOZIE': 'oozieserver_host',
+ 'HDFS': 'hadoop_host',
'HIVE': 'hivemetastore_host'
};
return this.get('parentView.categoryConfigsAll').findProperty('name', serviceMasterMap[this.get('parentView.service.serviceName')]).get('value');