step7_controller.js 43 KB

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