step7_controller.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. var numberUtils = require('utils/number_utils');
  20. var stringUtils = require('utils/string_utils');
  21. /**
  22. * By Step 7, we have the following information stored in App.db and set on this
  23. * controller by the router.
  24. *
  25. * selectedServices: App.db.selectedServices (the services that the user selected in Step 4)
  26. * masterComponentHosts: App.db.masterComponentHosts (master-components-to-hosts mapping the user selected in Step 5)
  27. * slaveComponentHosts: App.db.slaveComponentHosts (slave-components-to-hosts mapping the user selected in Step 6)
  28. *
  29. */
  30. App.WizardStep7Controller = Em.Controller.extend({
  31. name: 'wizardStep7Controller',
  32. /**
  33. * Contains all field properties that are viewed in this step
  34. * @type {object[]}
  35. */
  36. stepConfigs: [],
  37. selectedService: null,
  38. slaveHostToGroup: null,
  39. secureConfigs: require('data/secure_mapping'),
  40. /**
  41. * If miscConfigChange Modal is shown
  42. * @type {bool}
  43. */
  44. miscModalVisible: false,
  45. gangliaAvailableSpace: null,
  46. /**
  47. * @type {string}
  48. */
  49. gangliaMoutDir: '/',
  50. overrideToAdd: null,
  51. /**
  52. * Is installer controller used
  53. * @type {bool}
  54. */
  55. isInstaller: true,
  56. /**
  57. * List of config groups
  58. * @type {object[]}
  59. */
  60. configGroups: [],
  61. /**
  62. * List of config group to be deleted
  63. * @type {object[]}
  64. */
  65. groupsToDelete: [],
  66. preSelectedConfigGroup: null,
  67. /**
  68. * Currently selected config group
  69. * @type {object}
  70. */
  71. selectedConfigGroup: null,
  72. /**
  73. * Config tags of actually installed services
  74. * @type {array}
  75. */
  76. serviceConfigTags: [],
  77. serviceConfigsData: require('data/service_configs'),
  78. /**
  79. * Are advanced configs loaded
  80. * @type {bool}
  81. */
  82. isAdvancedConfigLoaded: true,
  83. /**
  84. * Are applied to service configs loaded
  85. * @type {bool}
  86. */
  87. isAppliedConfigLoaded: true,
  88. isConfigsLoaded: function () {
  89. return (this.get('isAdvancedConfigLoaded') && this.get('isAppliedConfigLoaded'));
  90. }.property('isAdvancedConfigLoaded', 'isAppliedConfigLoaded'),
  91. /**
  92. * Should Next-button be disabled
  93. * @type {bool}
  94. */
  95. isSubmitDisabled: function () {
  96. return (!this.stepConfigs.filterProperty('showConfig', true).everyProperty('errorCount', 0) || this.get("miscModalVisible"));
  97. }.property('stepConfigs.@each.errorCount', 'miscModalVisible'),
  98. /**
  99. * List of selected to install service names
  100. * @type {string[]}
  101. */
  102. selectedServiceNames: function () {
  103. return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false).mapProperty('serviceName');
  104. }.property('content.services').cacheable(),
  105. /**
  106. * List of installed and selected to install service names
  107. * @type {string[]}
  108. */
  109. allSelectedServiceNames: function () {
  110. return this.get('content.services').filterProperty('isSelected').mapProperty('serviceName');
  111. }.property('content.services').cacheable(),
  112. /**
  113. * List of installed service names
  114. * Sqoop and HCatalog are excluded if not installer wizard running
  115. * @type {string[]}
  116. */
  117. installedServiceNames: function () {
  118. var serviceNames = this.get('content.services').filterProperty('isInstalled').mapProperty('serviceName');
  119. if (this.get('content.controllerName') !== 'installerController') {
  120. return serviceNames.without('SQOOP').without('HCATALOG');
  121. }
  122. return serviceNames;
  123. }.property('content.services').cacheable(),
  124. /**
  125. * List of master components
  126. * @type {Ember.Enumerable}
  127. */
  128. masterComponentHosts: function () {
  129. return this.get('content.masterComponentHosts');
  130. }.property('content.masterComponentHosts'),
  131. /**
  132. * List of slave components
  133. * @type {Ember.Enumerable}
  134. */
  135. slaveComponentHosts: function () {
  136. return this.get('content.slaveGroupProperties');
  137. }.property('content.slaveGroupProperties', 'content.slaveComponentHosts'),
  138. customData: [],
  139. /**
  140. * Filter text will be located here
  141. * @type {string}
  142. */
  143. filter: '',
  144. /**
  145. * Dropdown menu items in filter combobox
  146. * @type {Ember.Object[]}
  147. */
  148. filterColumns: function () {
  149. var result = [];
  150. for (var i = 1; i < 2; i++) {
  151. result.push(Em.Object.create({
  152. name: this.t('common.combobox.dropdown.' + i),
  153. selected: false
  154. }));
  155. }
  156. return result;
  157. }.property(),
  158. /**
  159. * Clear controller's properties:
  160. * <ul>
  161. * <li>stepConfigs</li>
  162. * <li>filter</li>
  163. * </ul>
  164. * and desect all <code>filterColumns</code>
  165. * @method clearStep
  166. */
  167. clearStep: function () {
  168. this.get('stepConfigs').clear();
  169. this.set('filter', '');
  170. this.get('filterColumns').setEach('selected', false);
  171. },
  172. /**
  173. * Load config groups for installed services
  174. * One ajax-request for each service
  175. * @param {string[]} servicesNames
  176. * @method loadInstalledServicesConfigGroups
  177. */
  178. loadInstalledServicesConfigGroups: function (servicesNames) {
  179. servicesNames.forEach(function (serviceName) {
  180. App.ajax.send({
  181. name: 'config.tags_and_groups',
  182. sender: this,
  183. data: {
  184. serviceName: serviceName,
  185. serviceConfigsDef: App.config.get('preDefinedServiceConfigs').findProperty('serviceName', serviceName)
  186. },
  187. success: 'loadServiceTagsSuccess'
  188. });
  189. }, this);
  190. },
  191. /**
  192. * Create site to tag map. Format:
  193. * <code>
  194. * {
  195. * site1: tag1,
  196. * site1: tag2,
  197. * site2: tag3
  198. * ...
  199. * }
  200. * </code>
  201. * @param {object} desired_configs
  202. * @param {string[]} sites
  203. * @returns {object}
  204. * @private
  205. * @method _createSiteToTagMap
  206. */
  207. _createSiteToTagMap: function (desired_configs, sites) {
  208. var siteToTagMap = {};
  209. for (var site in desired_configs) {
  210. if (desired_configs.hasOwnProperty(site)) {
  211. if (sites.indexOf(site) > -1) {
  212. siteToTagMap[site] = desired_configs[site].tag;
  213. }
  214. }
  215. }
  216. return siteToTagMap;
  217. },
  218. /**
  219. * Load config groups success callback
  220. * @param {object} data
  221. * @param {object} opt
  222. * @param {object} params
  223. * @method loadServiceTagsSuccess
  224. */
  225. loadServiceTagsSuccess: function (data, opt, params) {
  226. var serviceName = params.serviceName,
  227. service = this.get('stepConfigs').findProperty('serviceName', serviceName),
  228. defaultConfigGroupHosts = this.get('wizardController.allHosts').mapProperty('hostName'),
  229. siteToTagMap = this._createSiteToTagMap(data.Clusters.desired_configs, params.serviceConfigsDef.sites),
  230. selectedConfigGroup;
  231. this.set('loadedClusterSiteToTagMap', siteToTagMap);
  232. //parse loaded config groups
  233. if (App.get('supports.hostOverrides')) {
  234. var configGroups = [];
  235. if (data.config_groups.length) {
  236. data.config_groups.forEach(function (item) {
  237. item = item.ConfigGroup;
  238. if (item.tag === serviceName) {
  239. var groupHosts = item.hosts.mapProperty('host_name');
  240. var newConfigGroup = App.ConfigGroup.create({
  241. id: item.id,
  242. name: item.group_name,
  243. description: item.description,
  244. isDefault: false,
  245. parentConfigGroup: null,
  246. service: App.Service.find().findProperty('serviceName', item.tag),
  247. hosts: groupHosts,
  248. configSiteTags: []
  249. });
  250. groupHosts.forEach(function (host) {
  251. defaultConfigGroupHosts = defaultConfigGroupHosts.without(host);
  252. }, this);
  253. item.desired_configs.forEach(function (config) {
  254. newConfigGroup.configSiteTags.push(App.ConfigSiteTag.create({
  255. site: config.type,
  256. tag: config.tag
  257. }));
  258. }, this);
  259. configGroups.push(newConfigGroup);
  260. }
  261. }, this);
  262. }
  263. }
  264. var defaultConfigGroup = App.ConfigGroup.create({
  265. name: App.Service.DisplayNames[serviceName] + " Default",
  266. description: "Default cluster level " + serviceName + " configuration",
  267. isDefault: true,
  268. hosts: defaultConfigGroupHosts,
  269. parentConfigGroup: null,
  270. service: Em.Object.create({
  271. id: serviceName
  272. }),
  273. serviceName: serviceName,
  274. configSiteTags: []
  275. });
  276. if (!selectedConfigGroup) {
  277. selectedConfigGroup = defaultConfigGroup;
  278. }
  279. configGroups = configGroups.sortProperty('name');
  280. configGroups.unshift(defaultConfigGroup);
  281. if (App.get('supports.hostOverrides')) {
  282. service.set('configGroups', configGroups);
  283. var loadedGroupToOverrideSiteToTagMap = {};
  284. if (App.get('supports.hostOverrides')) {
  285. var configGroupsWithOverrides = selectedConfigGroup.get('isDefault') ? service.get('configGroups') : [selectedConfigGroup];
  286. configGroupsWithOverrides.forEach(function (item) {
  287. var groupName = item.get('name');
  288. loadedGroupToOverrideSiteToTagMap[groupName] = {};
  289. item.get('configSiteTags').forEach(function (siteTag) {
  290. var site = siteTag.get('site');
  291. loadedGroupToOverrideSiteToTagMap[groupName][site] = siteTag.get('tag');
  292. }, this);
  293. }, this);
  294. }
  295. this.set('preSelectedConfigGroup', selectedConfigGroup);
  296. App.config.loadServiceConfigGroupOverrides(service.get('configs'), loadedGroupToOverrideSiteToTagMap, service.get('configGroups'), this.onLoadOverrides, this);
  297. }
  298. },
  299. onLoadOverrides: function (configs) {
  300. var serviceName = configs[0].serviceName,
  301. service = this.get('stepConfigs').findProperty('serviceName', serviceName);
  302. if (App.get('supports.hostOverrides')) {
  303. var serviceConfig = App.config.createServiceConfig(serviceName);
  304. if (serviceConfig.get('serviceName') === 'HDFS') {
  305. App.config.OnNnHAHideSnn(serviceConfig);
  306. }
  307. service.set('selectedConfigGroup', this.get('preSelectedConfigGroup'));
  308. this.loadComponentConfigs(service.get('configs'), serviceConfig, service);
  309. }
  310. service.set('configs', serviceConfig.get('configs'));
  311. },
  312. /**
  313. * Get object with recommended default values for config properties
  314. * Format:
  315. * <code>
  316. * {
  317. * configName1: configValue1,
  318. * configName2: configValue2
  319. * ...
  320. * }
  321. * </code>
  322. * @param {string} serviceName
  323. * @returns {object}
  324. * @method _getRecommendedDefaultsForComponent
  325. */
  326. _getRecommendedDefaultsForComponent: function (serviceName) {
  327. var s = this.get('serviceConfigsData').findProperty('serviceName', serviceName),
  328. recommendedDefaults = {},
  329. localDB = this.getInfoForDefaults();
  330. if (s.defaultsProviders) {
  331. s.defaultsProviders.forEach(function (defaultsProvider) {
  332. var d = defaultsProvider.getDefaults(localDB);
  333. for (var name in d) {
  334. if (d.hasOwnProperty(name)) {
  335. recommendedDefaults[name] = d[name];
  336. }
  337. }
  338. });
  339. }
  340. return recommendedDefaults;
  341. },
  342. /**
  343. * Get info about hosts and host components to configDefaultsProviders
  344. * Work specifically in Add Service wizard
  345. * @slaveComponentHosts - contains slaves and clients as well
  346. * @returns {{masterComponentHosts: Array, slaveComponentHosts: Array, hosts: {}}}
  347. */
  348. getInfoForDefaults: function() {
  349. var slaveComponentHosts = [];
  350. var hosts = this.get('content.hosts');
  351. var slaveHostMap = {};
  352. //get clients and slaves from stack
  353. App.StackServiceComponent.find().forEach(function (component) {
  354. if (component.get('isClient') || component.get('isSlave')) {
  355. slaveHostMap[component.get('componentName')] = [];
  356. }
  357. });
  358. //assign hosts of every component
  359. for (var hostName in hosts) {
  360. hosts[hostName].hostComponents.forEach(function (componentName) {
  361. if (slaveHostMap[componentName]) {
  362. slaveHostMap[componentName].push({hostName: hostName});
  363. }
  364. });
  365. }
  366. //push slaves and clients into @slaveComponentHosts
  367. for (var componentName in slaveHostMap) {
  368. if(slaveHostMap[componentName].length > 0) {
  369. slaveComponentHosts.push({
  370. componentName: componentName,
  371. hosts: slaveHostMap[componentName]
  372. })
  373. }
  374. }
  375. var masterComponentHosts = App.HostComponent.find().filterProperty('isMaster', true).map(function(item) {
  376. return {
  377. component: item.get('componentName'),
  378. serviceId: item.get('service.serviceName'),
  379. host: item.get('hostName')
  380. }
  381. });
  382. return {
  383. masterComponentHosts: masterComponentHosts,
  384. slaveComponentHosts: slaveComponentHosts,
  385. hosts: hosts
  386. };
  387. },
  388. /**
  389. * By default <code>value</code>-property is string "true|false".
  390. * Should update it to boolean type
  391. * Also affects <code>defaultValue</code>
  392. * @param {Ember.Object} serviceConfigProperty
  393. * @returns {Ember.Object} Updated config-object
  394. * @method _updateValueForCheckBoxConfig
  395. */
  396. _updateValueForCheckBoxConfig: function (serviceConfigProperty) {
  397. var v = serviceConfigProperty.get('value');
  398. switch (serviceConfigProperty.get('value')) {
  399. case 'true':
  400. v = true;
  401. break;
  402. case 'false':
  403. v = false;
  404. break;
  405. }
  406. serviceConfigProperty.setProperties({value: v, defaultValue: v});
  407. return serviceConfigProperty;
  408. },
  409. /**
  410. * Set <code>isEditable</code>-property to <code>serviceConfigProperty</code>
  411. * Based on user's permissions and selected config group
  412. * @param {Ember.Object} serviceConfigProperty
  413. * @param {bool} defaultGroupSelected
  414. * @returns {Ember.Object} Updated config-object
  415. * @method _updateIsEditableFlagForConfig
  416. */
  417. _updateIsEditableFlagForConfig: function (serviceConfigProperty, defaultGroupSelected) {
  418. if (App.get('isAdmin')) {
  419. if (defaultGroupSelected && !this.get('isHostsConfigsPage')) {
  420. serviceConfigProperty.set('isEditable', serviceConfigProperty.get('isReconfigurable'));
  421. }
  422. else {
  423. serviceConfigProperty.set('isEditable', false);
  424. }
  425. }
  426. else {
  427. serviceConfigProperty.set('isEditable', false);
  428. }
  429. return serviceConfigProperty;
  430. },
  431. /**
  432. * Set <code>overrides</code>-property to <code>serviceConfigProperty<code>
  433. * @param {Ember.Object} serviceConfigProperty
  434. * @param {Ember.Object} component
  435. * @return {Ember.Object} Updated config-object
  436. * @method _updateOverridesForConfig
  437. */
  438. _updateOverridesForConfig: function (serviceConfigProperty, component) {
  439. var overrides = serviceConfigProperty.get('overrides');
  440. if (Em.isNone(overrides)) {
  441. serviceConfigProperty.set('overrides', Em.A([]));
  442. return serviceConfigProperty;
  443. }
  444. serviceConfigProperty.set('overrides', null);
  445. var defaultGroupSelected = component.get('selectedConfigGroup.isDefault');
  446. // Wrap each override to App.ServiceConfigProperty
  447. overrides.forEach(function (override) {
  448. var newSCP = App.ServiceConfigProperty.create(serviceConfigProperty);
  449. newSCP.set('value', override.value);
  450. newSCP.set('isOriginalSCP', false); // indicated this is overridden value,
  451. newSCP.set('parentSCP', serviceConfigProperty);
  452. if (App.get('supports.hostOverrides') && defaultGroupSelected) {
  453. var group = component.get('configGroups').findProperty('name', override.group.get('name'));
  454. // prevent cycle in proto object, clean link
  455. if (group.get('properties').length == 0) {
  456. group.set('properties', Em.A([]));
  457. }
  458. group.get('properties').push(newSCP);
  459. newSCP.set('group', override.group);
  460. newSCP.set('isEditable', false);
  461. }
  462. var parentOverridesArray = serviceConfigProperty.get('overrides');
  463. if (Em.isNone(parentOverridesArray)) {
  464. parentOverridesArray = Em.A([]);
  465. serviceConfigProperty.set('overrides', parentOverridesArray);
  466. }
  467. serviceConfigProperty.get('overrides').pushObject(newSCP);
  468. }, this);
  469. return serviceConfigProperty;
  470. },
  471. /**
  472. * Set <code>serviceValidator</code>-property to <code>serviceConfigProperty</code> if config's serviceName is equal
  473. * to component's serviceName
  474. * othervise set <code>isVisible</code>-property to <code>false</code>
  475. * @param {Ember.Object} serviceConfigProperty
  476. * @param {Ember.Object} component
  477. * @param {object} serviceConfigsData
  478. * @returns {Ember.Object} updated config-object
  479. * @mrthod _updateValidatorsForConfig
  480. */
  481. _updateValidatorsForConfig: function (serviceConfigProperty, component, serviceConfigsData) {
  482. if (serviceConfigProperty.get('serviceName') === component.get('serviceName')) {
  483. if (serviceConfigsData.configsValidator) {
  484. var validators = serviceConfigsData.configsValidator.get('configValidators');
  485. for (var validatorName in validators) {
  486. if (validators.hasOwnProperty(validatorName)) {
  487. if (serviceConfigProperty.get('name') == validatorName) {
  488. serviceConfigProperty.set('serviceValidator', serviceConfigsData.configsValidator);
  489. }
  490. }
  491. }
  492. }
  493. }
  494. else {
  495. serviceConfigProperty.set('isVisible', false);
  496. }
  497. return serviceConfigProperty;
  498. },
  499. /**
  500. * Set configs with overrides, recommended defaults to component
  501. * @param {Ember.Object[]} configs
  502. * @param {Ember.Object} componentConfig
  503. * @param {Ember.Object} component
  504. * @method loadComponentConfigs
  505. */
  506. loadComponentConfigs: function (configs, componentConfig, component) {
  507. var s = this.get('serviceConfigsData').findProperty('serviceName', component.get('serviceName')),
  508. defaultGroupSelected = component.get('selectedConfigGroup.isDefault');
  509. if (s.configsValidator) {
  510. var recommendedDefaults = this._getRecommendedDefaultsForComponent(component.get('serviceName'));
  511. s.configsValidator.set('recommendedDefaults', recommendedDefaults);
  512. }
  513. configs.forEach(function (serviceConfigProperty) {
  514. if (!serviceConfigProperty) return;
  515. if (Em.isNone(serviceConfigProperty.get('isOverridable'))) {
  516. serviceConfigProperty.set('isOverridable', true);
  517. }
  518. if (serviceConfigProperty.get('displayType') === 'checkbox') {
  519. this._updateValueForCheckBoxConfig(serviceConfigProperty);
  520. }
  521. this._updateValidatorsForConfig(serviceConfigProperty, component, s);
  522. this._updateOverridesForConfig(serviceConfigProperty, component);
  523. this._updateIsEditableFlagForConfig(serviceConfigProperty, defaultGroupSelected);
  524. componentConfig.get('configs').pushObject(serviceConfigProperty);
  525. serviceConfigProperty.validate();
  526. }, this);
  527. var overrideToAdd = this.get('overrideToAdd');
  528. if (overrideToAdd) {
  529. overrideToAdd = componentConfig.get('configs').findProperty('name', overrideToAdd.name);
  530. if (overrideToAdd) {
  531. this.addOverrideProperty(overrideToAdd);
  532. component.set('overrideToAdd', null);
  533. }
  534. }
  535. },
  536. /**
  537. * Resolve dependency between configs.
  538. * @param serviceName {String}
  539. * @param configs {Ember.Enumerable}
  540. */
  541. resolveServiceDependencyConfigs: function (serviceName, configs) {
  542. switch (serviceName) {
  543. case 'STORM':
  544. this.resolveStormConfigs(configs);
  545. break;
  546. default:
  547. break;
  548. }
  549. },
  550. /**
  551. * Update some Storm configs
  552. * If Ganglia is selected to install or already installed, Ganglia host should be added to configs
  553. * @param {Ember.Enumerable} configs
  554. * @method resolveStormConfigs
  555. */
  556. resolveStormConfigs: function (configs) {
  557. var dependentConfigs, gangliaServerHost;
  558. dependentConfigs = ['nimbus.childopts', 'supervisor.childopts', 'worker.childopts'];
  559. // if Ganglia selected or installed, set ganglia host to configs
  560. if (this.get('installedServiceNames').contains('STORM') && this.get('installedServiceNames').contains('GANGLIA')) return;
  561. if (this.get('allSelectedServiceNames').contains('GANGLIA') || this.get('installedServiceNames').contains('GANGLIA')) {
  562. gangliaServerHost = this.get('wizardController').getDBProperty('masterComponentHosts').findProperty('component', 'GANGLIA_SERVER').hostName;
  563. dependentConfigs.forEach(function (configName) {
  564. var config = configs.findProperty('name', configName);
  565. var replaceStr = config.value.match(/.jar=host[^,]+/)[0];
  566. var replaceWith = replaceStr.slice(0, replaceStr.lastIndexOf('=') - replaceStr.length + 1) + gangliaServerHost;
  567. config.value = config.defaultValue = config.value.replace(replaceStr, replaceWith);
  568. config.forceUpdate = true;
  569. }, this);
  570. }
  571. },
  572. /**
  573. * On load function
  574. * @method loadStep
  575. */
  576. loadStep: function () {
  577. console.log("TRACE: Loading step7: Configure Services");
  578. if (!this.get('isConfigsLoaded')) {
  579. return;
  580. }
  581. this.clearStep();
  582. //STEP 1: Load advanced configs
  583. var advancedConfigs = this.get('content.advancedServiceConfig');
  584. //STEP 2: Load on-site configs by service from local DB
  585. var storedConfigs = this.get('content.serviceConfigProperties');
  586. //STEP 3: Merge pre-defined configs with loaded on-site configs
  587. var configs = App.config.mergePreDefinedWithStored(
  588. storedConfigs,
  589. advancedConfigs,
  590. this.get('selectedServiceNames').concat(this.get('installedServiceNames'))
  591. );
  592. //STEP 4: Add advanced configs
  593. App.config.addAdvancedConfigs(configs, advancedConfigs);
  594. //STEP 5: Add custom configs
  595. App.config.addCustomConfigs(configs);
  596. //put properties from capacity-scheduler.xml into one config with textarea view
  597. if (this.get('allSelectedServiceNames').contains('YARN') && !App.get('supports.capacitySchedulerUi')) {
  598. configs = App.config.fileConfigsIntoTextarea(configs, 'capacity-scheduler.xml');
  599. }
  600. this.set('groupsToDelete', this.get('wizardController').getDBProperty('groupsToDelete') || []);
  601. if (this.get('wizardController.name') === 'addServiceController') {
  602. this.setInstalledServiceConfigs(this.get('serviceConfigTags'), configs);
  603. }
  604. if (this.get('allSelectedServiceNames').contains('STORM') || this.get('installedServiceNames').contains('STORM')) {
  605. this.resolveServiceDependencyConfigs('STORM', configs);
  606. }
  607. //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty (configs -> serviceConfigs)
  608. this.setStepConfigs(configs, storedConfigs);
  609. this.checkHostOverrideInstaller();
  610. this.activateSpecialConfigs();
  611. this.selectProperService();
  612. if (this.get('content.skipConfigStep')) {
  613. App.router.send('next');
  614. }
  615. },
  616. /**
  617. * If <code>App.supports.hostOverridesInstaller</code> is enabled should load config groups
  618. * and (if some services are already installed) load config groups for installed services
  619. * @method checkHostOverrideInstaller
  620. */
  621. checkHostOverrideInstaller: function () {
  622. if (App.get('supports.hostOverridesInstaller')) {
  623. this.loadConfigGroups(this.get('content.configGroups'));
  624. if (this.get('installedServiceNames').length > 0) {
  625. this.loadInstalledServicesConfigGroups(this.get('installedServiceNames'));
  626. }
  627. }
  628. },
  629. /**
  630. * Set init <code>stepConfigs</code> value
  631. * Set <code>selected</code> for addable services if addServiceController is used
  632. * Remove SNameNode if HA is enabled (and if addServiceController is used)
  633. * @param {Ember.Object[]} configs
  634. * @param {Ember.Object[]} storedConfigs
  635. * @method setStepConfigs
  636. */
  637. setStepConfigs: function (configs, storedConfigs) {
  638. var localDB = {
  639. hosts: this.get('wizardController.content.hosts'),
  640. masterComponentHosts: this.get('wizardController.content.masterComponentHosts'),
  641. slaveComponentHosts: this.get('wizardController.content.slaveComponentHosts')
  642. };
  643. var serviceConfigs = App.config.renderConfigs(configs, storedConfigs, this.get('allSelectedServiceNames'), this.get('installedServiceNames'), localDB);
  644. if (this.get('wizardController.name') === 'addServiceController') {
  645. serviceConfigs.setEach('showConfig', true);
  646. serviceConfigs.setEach('selected', false);
  647. this.get('selectedServiceNames').forEach(function (serviceName) {
  648. if (!serviceConfigs.findProperty('serviceName', serviceName)) return;
  649. serviceConfigs.findProperty('serviceName', serviceName).set('selected', true);
  650. });
  651. // Remove SNameNode if HA is enabled
  652. if (App.get('isHaEnabled')) {
  653. var c = serviceConfigs.findProperty('serviceName', 'HDFS').configs;
  654. var removedConfigs = c.filterProperty('category', 'SNameNode');
  655. removedConfigs.map(function (config) {
  656. c = c.without(config);
  657. });
  658. serviceConfigs.findProperty('serviceName', 'HDFS').configs = c;
  659. }
  660. }
  661. this.set('stepConfigs', serviceConfigs);
  662. },
  663. /**
  664. * Select first addable service for <code>addServiceWizard</code>
  665. * Select first service at all in other cases
  666. * @method selectProperService
  667. */
  668. selectProperService: function () {
  669. if (this.get('wizardController.name') === 'addServiceController') {
  670. this.set('selectedService', this.get('stepConfigs').filterProperty('selected', true).get('firstObject'));
  671. }
  672. else {
  673. this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
  674. }
  675. },
  676. /**
  677. * Load config tags
  678. * @return {$.ajax|null}
  679. * @method getConfigTags
  680. */
  681. getConfigTags: function () {
  682. this.set('isAppliedConfigLoaded', false);
  683. return App.ajax.send({
  684. name: 'config.tags',
  685. sender: this,
  686. success: 'getConfigTagsSuccess'
  687. });
  688. },
  689. /**
  690. * Success callback for config tags request
  691. * Updates <code>serviceConfigTags</code> with tags received from server
  692. * @param {object} data
  693. * @method getConfigTagsSuccess
  694. */
  695. getConfigTagsSuccess: function (data) {
  696. var installedServiceSites = [];
  697. this.get('serviceConfigsData').filter(function (service) {
  698. if (this.get('installedServiceNames').contains(service.serviceName)) {
  699. installedServiceSites = installedServiceSites.concat(service.sites);
  700. }
  701. }, this);
  702. installedServiceSites = installedServiceSites.uniq();
  703. var serviceConfigTags = [];
  704. for (var site in data.Clusters.desired_configs) {
  705. if (data.Clusters.desired_configs.hasOwnProperty(site)) {
  706. if (installedServiceSites.contains(site)) {
  707. serviceConfigTags.push({
  708. siteName: site,
  709. tagName: data.Clusters.desired_configs[site].tag,
  710. newTagName: null
  711. });
  712. }
  713. }
  714. }
  715. this.set('serviceConfigTags', serviceConfigTags);
  716. this.set('isAppliedConfigLoaded', true);
  717. },
  718. /**
  719. * set configs actual values from server
  720. * @param serviceConfigTags
  721. * @param configs
  722. * @method setInstalledServiceConfigs
  723. */
  724. setInstalledServiceConfigs: function (serviceConfigTags, configs) {
  725. var configsMap = {};
  726. var configTypeMap = {};
  727. var configMixin = App.get('config');
  728. App.router.get('configurationController').getConfigsByTags(serviceConfigTags).forEach(function (configSite) {
  729. $.extend(configsMap, configSite.properties);
  730. for (var name in configSite.properties) {
  731. configTypeMap[name] = configSite.type;
  732. }
  733. });
  734. configs.forEach(function (_config) {
  735. if (!Em.isNone(configsMap[_config.name])) {
  736. // prevent overriding already edited properties
  737. if (_config.defaultValue != configsMap[_config.name])
  738. _config.value = configsMap[_config.name];
  739. _config.defaultValue = configsMap[_config.name];
  740. _config.hasInitialValue = true;
  741. App.config.handleSpecialProperties(_config);
  742. delete configsMap[_config.name];
  743. }
  744. });
  745. //add user properties
  746. for (var name in configsMap) {
  747. configs.push(configMixin.addUserProperty({
  748. id: 'site property',
  749. name: name,
  750. serviceName: configMixin.getServiceNameByConfigType(configTypeMap[name]),
  751. value: configsMap[name],
  752. defaultValue: configsMap[name],
  753. filename: (configMixin.get('filenameExceptions').contains(configTypeMap[name])) ? configTypeMap[name] : configTypeMap[name] + '.xml',
  754. category: 'Advanced',
  755. isUserProperty: true,
  756. isOverridable: true,
  757. overrides: [],
  758. isRequired: true,
  759. isVisible: true,
  760. showLabel: true
  761. }, false, []));
  762. }
  763. },
  764. /**
  765. * Add group ids to <code>groupsToDelete</code>
  766. * Also save <code>groupsToDelete</code> to local storage
  767. * @param {Ember.Object[]} groups
  768. * @method setGroupsToDelete
  769. */
  770. setGroupsToDelete: function (groups) {
  771. var groupsToDelete = this.get('groupsToDelete');
  772. groups.forEach(function (group) {
  773. if (group.get('id'))
  774. groupsToDelete.push({
  775. id: group.get('id')
  776. });
  777. });
  778. this.get('wizardController').setDBProperty('groupsToDelete', groupsToDelete);
  779. },
  780. /**
  781. * Update <code>configGroups</code> with selected service configGroups
  782. * Also set default group to first position
  783. * Update <code>selectedConfigGroup</code> with new default group
  784. * @method selectedServiceObserver
  785. */
  786. selectedServiceObserver: function () {
  787. if (App.supports.hostOverridesInstaller && this.get('selectedService') && (this.get('selectedService.serviceName') !== 'MISC')) {
  788. var serviceGroups = this.get('selectedService.configGroups');
  789. serviceGroups.forEach(function (item, index, array) {
  790. if (item.isDefault) {
  791. array.unshift(item);
  792. array.splice(index + 1, 1);
  793. }
  794. });
  795. this.set('configGroups', serviceGroups);
  796. this.set('selectedConfigGroup', serviceGroups.findProperty('isDefault'));
  797. }
  798. }.observes('selectedService.configGroups.@each'),
  799. /**
  800. * load default groups for each service in case of initial load
  801. * @param serviceConfigGroups
  802. * @method loadConfigGroups
  803. */
  804. loadConfigGroups: function (serviceConfigGroups) {
  805. var services = this.get('stepConfigs');
  806. var hosts = this.get('wizardController.allHosts').mapProperty('hostName');
  807. services.forEach(function (service) {
  808. if (service.get('serviceName') === 'MISC') return;
  809. var serviceRawGroups = serviceConfigGroups.filterProperty('service.id', service.serviceName);
  810. if (!serviceRawGroups.length) {
  811. service.set('configGroups', [
  812. App.ConfigGroup.create({
  813. name: App.Service.DisplayNames[service.serviceName] + " Default",
  814. description: "Default cluster level " + service.serviceName + " configuration",
  815. isDefault: true,
  816. hosts: Em.copy(hosts),
  817. service: Em.Object.create({
  818. id: service.serviceName
  819. }),
  820. serviceName: service.serviceName
  821. })
  822. ]);
  823. }
  824. else {
  825. var defaultGroup = App.ConfigGroup.create(serviceRawGroups.findProperty('isDefault'));
  826. var serviceGroups = service.get('configGroups');
  827. serviceRawGroups.filterProperty('isDefault', false).forEach(function (configGroup) {
  828. var readyGroup = App.ConfigGroup.create(configGroup);
  829. var wrappedProperties = [];
  830. readyGroup.get('properties').forEach(function (property) {
  831. wrappedProperties.pushObject(App.ServiceConfigProperty.create(property));
  832. });
  833. wrappedProperties.setEach('group', readyGroup);
  834. readyGroup.set('properties', wrappedProperties);
  835. readyGroup.set('parentConfigGroup', defaultGroup);
  836. serviceGroups.pushObject(readyGroup);
  837. });
  838. defaultGroup.set('childConfigGroups', serviceGroups);
  839. serviceGroups.pushObject(defaultGroup);
  840. }
  841. });
  842. },
  843. /**
  844. * Click-handler on config-group to make it selected
  845. * @param {object} event
  846. * @method selectConfigGroup
  847. */
  848. selectConfigGroup: function (event) {
  849. this.set('selectedConfigGroup', event.context);
  850. },
  851. /**
  852. * Rebuild list of configs switch of config group:
  853. * on default - display all configs from default group and configs from non-default groups as disabled
  854. * on non-default - display all from default group as disabled and configs from selected non-default group
  855. * @method switchConfigGroupConfigs
  856. */
  857. switchConfigGroupConfigs: function () {
  858. var serviceConfigs = this.get('selectedService.configs'),
  859. selectedGroup = this.get('selectedConfigGroup'),
  860. overrideToAdd = this.get('overrideToAdd'),
  861. overrides = [];
  862. if (!selectedGroup) return;
  863. var displayedConfigGroups = this._getDisplayedConfigGroups();
  864. displayedConfigGroups.forEach(function (group) {
  865. overrides.pushObjects(group.get('properties'));
  866. });
  867. serviceConfigs.forEach(function (config) {
  868. this._setEditableValue(config);
  869. this._setOverrides(config, overrides);
  870. }, this);
  871. }.observes('selectedConfigGroup'),
  872. /**
  873. * Get list of config groups to display
  874. * Returns empty array if no <code>selectedConfigGroup</code>
  875. * @return {Array}
  876. * @method _getDisplayedConfigGroups
  877. */
  878. _getDisplayedConfigGroups: function () {
  879. var selectedGroup = this.get('selectedConfigGroup');
  880. if (!selectedGroup) return [];
  881. return (selectedGroup.get('isDefault')) ?
  882. this.get('selectedService.configGroups').filterProperty('isDefault', false) :
  883. [this.get('selectedConfigGroup')];
  884. },
  885. /**
  886. * Set <code>isEditable</code> property to <code>config</code>
  887. * @param {Ember.Object} config
  888. * @return {Ember.Object} updated config-object
  889. * @method _setEditableValue
  890. */
  891. _setEditableValue: function (config) {
  892. var selectedGroup = this.get('selectedConfigGroup');
  893. if (!selectedGroup) return config;
  894. var isEditable = config.get('isEditable'),
  895. isServiceInstalled = this.get('installedServiceNames').contains(this.get('selectedService.serviceName'));
  896. if (isServiceInstalled) {
  897. isEditable = (!isEditable && !config.get('isReconfigurable')) ? false : selectedGroup.get('isDefault');
  898. }
  899. else {
  900. isEditable = selectedGroup.get('isDefault');
  901. }
  902. config.set('isEditable', isEditable);
  903. return config;
  904. },
  905. /**
  906. * Set <code>overrides</code> property to <code>config</code>
  907. * @param {Ember.Object} config
  908. * @param {Ember.Enumerable} overrides
  909. * @returns {Ember.Object}
  910. * @method _setOverrides
  911. */
  912. _setOverrides: function (config, overrides) {
  913. var selectedGroup = this.get('selectedConfigGroup'),
  914. overrideToAdd = this.get('overrideToAdd'),
  915. configOverrides = overrides.filterProperty('name', config.get('name'));
  916. if (!selectedGroup) return config;
  917. if (overrideToAdd && overrideToAdd.get('name') === config.get('name')) {
  918. configOverrides.push(this.addOverrideProperty(config));
  919. this.set('overrideToAdd', null);
  920. }
  921. configOverrides.setEach('isEditable', !selectedGroup.get('isDefault'));
  922. configOverrides.setEach('parentSCP', config);
  923. config.set('overrides', configOverrides);
  924. return config;
  925. },
  926. /**
  927. * create overriden property and push it into Config group
  928. * @param {App.ServiceConfigProperty} serviceConfigProperty
  929. * @return {App.ServiceConfigProperty}
  930. * @method addOverrideProperty
  931. */
  932. addOverrideProperty: function (serviceConfigProperty) {
  933. var overrides = serviceConfigProperty.get('overrides') || [];
  934. var newSCP = App.ServiceConfigProperty.create(serviceConfigProperty);
  935. var group = this.get('selectedService.configGroups').findProperty('name', this.get('selectedConfigGroup.name'));
  936. newSCP.set('group', group);
  937. newSCP.set('value', '');
  938. newSCP.set('isOriginalSCP', false); // indicated this is overridden value,
  939. newSCP.set('parentSCP', serviceConfigProperty);
  940. newSCP.set('isEditable', true);
  941. group.get('properties').pushObject(newSCP);
  942. overrides.pushObject(newSCP);
  943. return newSCP;
  944. },
  945. /**
  946. * @method manageConfigurationGroup
  947. */
  948. manageConfigurationGroup: function () {
  949. App.router.get('mainServiceInfoConfigsController').manageConfigurationGroups(this);
  950. },
  951. /**
  952. * Make some configs visible depending on active services
  953. * @method activateSpecialConfigs
  954. */
  955. activateSpecialConfigs: function () {
  956. var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
  957. miscConfigs = App.config.miscConfigVisibleProperty(miscConfigs, this.get('selectedServiceNames'));
  958. },
  959. /**
  960. * Check whether hive New MySQL database is on the same host as Ambari server MySQL server
  961. * @return {$.ajax|null}
  962. * @method checkMySQLHost
  963. */
  964. checkMySQLHost: function () {
  965. // get ambari database type and hostname
  966. return App.ajax.send({
  967. name: 'config.ambari.database.info',
  968. sender: this,
  969. success: 'getAmbariDatabaseSuccess'
  970. });
  971. },
  972. /**
  973. * Success callback for ambari database, get Ambari DB type and DB server hostname, then
  974. * Check whether hive New MySQL database is on the same host as Ambari server MySQL server
  975. * @param {object} data
  976. * @method getAmbariDatabaseSuccess
  977. */
  978. getAmbariDatabaseSuccess: function (data) {
  979. var hiveDBHostname = this.get('stepConfigs').findProperty('serviceName', 'HIVE').configs.findProperty('name', 'hivemetastore_host').value;
  980. var ambariServiceHostComponents = data.hostComponents;
  981. if (!!ambariServiceHostComponents.length) {
  982. var ambariDBInfo = JSON.stringify(ambariServiceHostComponents[0].RootServiceHostComponents.properties);
  983. this.set('mySQLServerConflict', ambariDBInfo.indexOf('mysql') > 0 && ambariDBInfo.indexOf(hiveDBHostname) > 0);
  984. } else {
  985. this.set('mySQLServerConflict', false);
  986. }
  987. },
  988. /**
  989. * Check if new MySql database was chosen for Hive service
  990. * and it is not located on the same host as Ambari server
  991. * that using MySql database too.
  992. *
  993. * @method resolveHiveMysqlDatabase
  994. **/
  995. resolveHiveMysqlDatabase: function() {
  996. var hiveService = this.get('content.services').findProperty('serviceName', 'HIVE');
  997. if (!hiveService || !hiveService.get('isSelected') || hiveService.get('isInstalled')) {
  998. this.moveNext();
  999. return;
  1000. }
  1001. var hiveDBType = this.get('stepConfigs').findProperty('serviceName', 'HIVE').configs.findProperty('name', 'hive_database').value;
  1002. if (hiveDBType == 'New MySQL Database') {
  1003. var self= this;
  1004. this.checkMySQLHost().done(function () {
  1005. if (self.get('mySQLServerConflict')) {
  1006. // error popup before you can proceed
  1007. return App.ModalPopup.show({
  1008. header: Em.I18n.t('installer.step7.popup.mySQLWarning.header'),
  1009. bodyClass: Ember.View.extend({
  1010. template: Ember.Handlebars.compile(Em.I18n.t('installer.step7.popup.mySQLWarning.body'))
  1011. }),
  1012. secondary: Em.I18n.t('installer.step7.popup.mySQLWarning.button.gotostep5'),
  1013. primary: Em.I18n.t('installer.step7.popup.mySQLWarning.button.dismiss'),
  1014. onSecondary: function (){
  1015. var parent = this;
  1016. return App.ModalPopup.show({
  1017. header: Em.I18n.t('installer.step7.popup.mySQLWarning.confirmation.header'),
  1018. bodyClass: Ember.View.extend({
  1019. template: Ember.Handlebars.compile( Em.I18n.t('installer.step7.popup.mySQLWarning.confirmation.body'))
  1020. }),
  1021. onPrimary: function (){
  1022. this.hide();
  1023. parent.hide();
  1024. // go back to step 5: assign masters and disable default navigation warning
  1025. App.router.get('installerController').gotoStep(5, true);
  1026. }
  1027. });
  1028. }
  1029. });
  1030. } else {
  1031. self.moveNext();
  1032. }
  1033. });
  1034. } else {
  1035. this.moveNext();
  1036. }
  1037. },
  1038. checkDatabaseConnectionTest: function() {
  1039. var deferred = $.Deferred();
  1040. if (!App.supports.databaseConnection) {
  1041. deferred.resolve();
  1042. return deferred;
  1043. }
  1044. var configMap = [
  1045. {
  1046. serviceName: 'OOZIE',
  1047. ignored: Em.I18n.t('installer.step7.oozie.database.new')
  1048. },
  1049. {
  1050. serviceName: 'HIVE',
  1051. ignored: Em.I18n.t('installer.step7.hive.database.new')
  1052. }
  1053. ];
  1054. configMap.forEach(function(config) {
  1055. var isConnectionNotTested = false;
  1056. var service = this.get('content.services').findProperty('serviceName', config.serviceName);
  1057. if (service && service.get('isSelected') && !service.get('isInstalled')) {
  1058. var serviceConfigs = this.get('stepConfigs').findProperty('serviceName', config.serviceName).configs;
  1059. var serviceDatabase = serviceConfigs.findProperty('name', config.serviceName.toLowerCase() + '_database').get('value');
  1060. if (serviceDatabase !== config.ignored) {
  1061. var filledProperties = App.db.get('tmp', config.serviceName + '_connection');
  1062. if (!filledProperties || App.isEmptyObject(filledProperties)) {
  1063. isConnectionNotTested = true;
  1064. } else {
  1065. for (var key in filledProperties) {
  1066. if (serviceConfigs.findProperty('name', key).get('value') !== filledProperties[key])
  1067. isConnectionNotTested = true;
  1068. }
  1069. }
  1070. }
  1071. }
  1072. config.isCheckIgnored = isConnectionNotTested;
  1073. }, this);
  1074. var ignoredServices = configMap.filterProperty('isCheckIgnored', true);
  1075. if (ignoredServices.length) {
  1076. var displayedServiceNames = ignoredServices.mapProperty('serviceName').map(function(serviceName) {
  1077. return App.Service.DisplayNames[serviceName];
  1078. }, this);
  1079. this.showDatabaseConnectionWarningPopup(displayedServiceNames, deferred);
  1080. }
  1081. else {
  1082. deferred.resolve();
  1083. }
  1084. return deferred;
  1085. },
  1086. showDatabaseConnectionWarningPopup: function(serviceNames, deferred) {
  1087. return App.ModalPopup.show({
  1088. header: Em.I18n.t('installer.step7.popup.database.connection.header'),
  1089. body: Em.I18n.t('installer.step7.popup.database.connection.body').format(serviceNames.join(', ')),
  1090. secondary: Em.I18n.t('common.cancel'),
  1091. primary: Em.I18n.t('common.proceedAnyway'),
  1092. onPrimary: function() {
  1093. deferred.resolve();
  1094. this._super();
  1095. },
  1096. onSecondary: function() {
  1097. deferred.reject();
  1098. this._super();
  1099. }
  1100. })
  1101. },
  1102. /**
  1103. * Proceed to the next step
  1104. **/
  1105. moveNext: function() {
  1106. App.router.send('next');
  1107. },
  1108. /**
  1109. * Click-handler on Next button
  1110. * @method submit
  1111. */
  1112. submit: function () {
  1113. var _this = this;
  1114. if (!this.get('isSubmitDisabled')) {
  1115. this.checkDatabaseConnectionTest().done(function() {
  1116. _this.resolveHiveMysqlDatabase();
  1117. });
  1118. }
  1119. }
  1120. });