step7_controller.js 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212
  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. App.config.handleSpecialProperties(_config);
  741. delete configsMap[_config.name];
  742. }
  743. });
  744. //add user properties
  745. for (var name in configsMap) {
  746. configs.push(configMixin.addUserProperty({
  747. id: 'site property',
  748. name: name,
  749. serviceName: configMixin.getServiceNameByConfigType(configTypeMap[name]),
  750. value: configsMap[name],
  751. defaultValue: configsMap[name],
  752. filename: (configMixin.get('filenameExceptions').contains(configTypeMap[name])) ? configTypeMap[name] : configTypeMap[name] + '.xml',
  753. category: 'Advanced',
  754. isUserProperty: true,
  755. isOverridable: true,
  756. overrides: [],
  757. isRequired: true,
  758. isVisible: true,
  759. showLabel: true
  760. }, false, []));
  761. }
  762. },
  763. /**
  764. * Add group ids to <code>groupsToDelete</code>
  765. * Also save <code>groupsToDelete</code> to local storage
  766. * @param {Ember.Object[]} groups
  767. * @method setGroupsToDelete
  768. */
  769. setGroupsToDelete: function (groups) {
  770. var groupsToDelete = this.get('groupsToDelete');
  771. groups.forEach(function (group) {
  772. if (group.get('id'))
  773. groupsToDelete.push({
  774. id: group.get('id')
  775. });
  776. });
  777. this.get('wizardController').setDBProperty('groupsToDelete', groupsToDelete);
  778. },
  779. /**
  780. * Update <code>configGroups</code> with selected service configGroups
  781. * Also set default group to first position
  782. * Update <code>selectedConfigGroup</code> with new default group
  783. * @method selectedServiceObserver
  784. */
  785. selectedServiceObserver: function () {
  786. if (App.supports.hostOverridesInstaller && this.get('selectedService') && (this.get('selectedService.serviceName') !== 'MISC')) {
  787. var serviceGroups = this.get('selectedService.configGroups');
  788. serviceGroups.forEach(function (item, index, array) {
  789. if (item.isDefault) {
  790. array.unshift(item);
  791. array.splice(index + 1, 1);
  792. }
  793. });
  794. this.set('configGroups', serviceGroups);
  795. this.set('selectedConfigGroup', serviceGroups.findProperty('isDefault'));
  796. }
  797. }.observes('selectedService.configGroups.@each'),
  798. /**
  799. * load default groups for each service in case of initial load
  800. * @param serviceConfigGroups
  801. * @method loadConfigGroups
  802. */
  803. loadConfigGroups: function (serviceConfigGroups) {
  804. var services = this.get('stepConfigs');
  805. var hosts = this.get('wizardController.allHosts').mapProperty('hostName');
  806. services.forEach(function (service) {
  807. if (service.get('serviceName') === 'MISC') return;
  808. var serviceRawGroups = serviceConfigGroups.filterProperty('service.id', service.serviceName);
  809. if (!serviceRawGroups.length) {
  810. service.set('configGroups', [
  811. App.ConfigGroup.create({
  812. name: App.Service.DisplayNames[service.serviceName] + " Default",
  813. description: "Default cluster level " + service.serviceName + " configuration",
  814. isDefault: true,
  815. hosts: Em.copy(hosts),
  816. service: Em.Object.create({
  817. id: service.serviceName
  818. }),
  819. serviceName: service.serviceName
  820. })
  821. ]);
  822. }
  823. else {
  824. var defaultGroup = App.ConfigGroup.create(serviceRawGroups.findProperty('isDefault'));
  825. var serviceGroups = service.get('configGroups');
  826. serviceRawGroups.filterProperty('isDefault', false).forEach(function (configGroup) {
  827. var readyGroup = App.ConfigGroup.create(configGroup);
  828. var wrappedProperties = [];
  829. readyGroup.get('properties').forEach(function (property) {
  830. wrappedProperties.pushObject(App.ServiceConfigProperty.create(property));
  831. });
  832. wrappedProperties.setEach('group', readyGroup);
  833. readyGroup.set('properties', wrappedProperties);
  834. readyGroup.set('parentConfigGroup', defaultGroup);
  835. serviceGroups.pushObject(readyGroup);
  836. });
  837. defaultGroup.set('childConfigGroups', serviceGroups);
  838. serviceGroups.pushObject(defaultGroup);
  839. }
  840. });
  841. },
  842. /**
  843. * Click-handler on config-group to make it selected
  844. * @param {object} event
  845. * @method selectConfigGroup
  846. */
  847. selectConfigGroup: function (event) {
  848. this.set('selectedConfigGroup', event.context);
  849. },
  850. /**
  851. * Rebuild list of configs switch of config group:
  852. * on default - display all configs from default group and configs from non-default groups as disabled
  853. * on non-default - display all from default group as disabled and configs from selected non-default group
  854. * @method switchConfigGroupConfigs
  855. */
  856. switchConfigGroupConfigs: function () {
  857. var serviceConfigs = this.get('selectedService.configs'),
  858. selectedGroup = this.get('selectedConfigGroup'),
  859. overrideToAdd = this.get('overrideToAdd'),
  860. overrides = [];
  861. if (!selectedGroup) return;
  862. var displayedConfigGroups = this._getDisplayedConfigGroups();
  863. displayedConfigGroups.forEach(function (group) {
  864. overrides.pushObjects(group.get('properties'));
  865. });
  866. serviceConfigs.forEach(function (config) {
  867. this._setEditableValue(config);
  868. this._setOverrides(config, overrides);
  869. }, this);
  870. }.observes('selectedConfigGroup'),
  871. /**
  872. * Get list of config groups to display
  873. * Returns empty array if no <code>selectedConfigGroup</code>
  874. * @return {Array}
  875. * @method _getDisplayedConfigGroups
  876. */
  877. _getDisplayedConfigGroups: function () {
  878. var selectedGroup = this.get('selectedConfigGroup');
  879. if (!selectedGroup) return [];
  880. return (selectedGroup.get('isDefault')) ?
  881. this.get('selectedService.configGroups').filterProperty('isDefault', false) :
  882. [this.get('selectedConfigGroup')];
  883. },
  884. /**
  885. * Set <code>isEditable</code> property to <code>config</code>
  886. * @param {Ember.Object} config
  887. * @return {Ember.Object} updated config-object
  888. * @method _setEditableValue
  889. */
  890. _setEditableValue: function (config) {
  891. var selectedGroup = this.get('selectedConfigGroup');
  892. if (!selectedGroup) return config;
  893. var isEditable = config.get('isEditable'),
  894. isServiceInstalled = this.get('installedServiceNames').contains(this.get('selectedService.serviceName'));
  895. if (isServiceInstalled) {
  896. isEditable = (!isEditable && !config.get('isReconfigurable')) ? false : selectedGroup.get('isDefault');
  897. }
  898. else {
  899. isEditable = selectedGroup.get('isDefault');
  900. }
  901. config.set('isEditable', isEditable);
  902. return config;
  903. },
  904. /**
  905. * Set <code>overrides</code> property to <code>config</code>
  906. * @param {Ember.Object} config
  907. * @param {Ember.Enumerable} overrides
  908. * @returns {Ember.Object}
  909. * @method _setOverrides
  910. */
  911. _setOverrides: function (config, overrides) {
  912. var selectedGroup = this.get('selectedConfigGroup'),
  913. overrideToAdd = this.get('overrideToAdd'),
  914. configOverrides = overrides.filterProperty('name', config.get('name'));
  915. if (!selectedGroup) return config;
  916. if (overrideToAdd && overrideToAdd.get('name') === config.get('name')) {
  917. configOverrides.push(this.addOverrideProperty(config));
  918. this.set('overrideToAdd', null);
  919. }
  920. configOverrides.setEach('isEditable', !selectedGroup.get('isDefault'));
  921. configOverrides.setEach('parentSCP', config);
  922. config.set('overrides', configOverrides);
  923. return config;
  924. },
  925. /**
  926. * create overriden property and push it into Config group
  927. * @param {App.ServiceConfigProperty} serviceConfigProperty
  928. * @return {App.ServiceConfigProperty}
  929. * @method addOverrideProperty
  930. */
  931. addOverrideProperty: function (serviceConfigProperty) {
  932. var overrides = serviceConfigProperty.get('overrides') || [];
  933. var newSCP = App.ServiceConfigProperty.create(serviceConfigProperty);
  934. var group = this.get('selectedService.configGroups').findProperty('name', this.get('selectedConfigGroup.name'));
  935. newSCP.set('group', group);
  936. newSCP.set('value', '');
  937. newSCP.set('isOriginalSCP', false); // indicated this is overridden value,
  938. newSCP.set('parentSCP', serviceConfigProperty);
  939. newSCP.set('isEditable', true);
  940. group.get('properties').pushObject(newSCP);
  941. overrides.pushObject(newSCP);
  942. return newSCP;
  943. },
  944. /**
  945. * @method manageConfigurationGroup
  946. */
  947. manageConfigurationGroup: function () {
  948. App.router.get('mainServiceInfoConfigsController').manageConfigurationGroups(this);
  949. },
  950. /**
  951. * Make some configs visible depending on active services
  952. * @method activateSpecialConfigs
  953. */
  954. activateSpecialConfigs: function () {
  955. var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
  956. miscConfigs = App.config.miscConfigVisibleProperty(miscConfigs, this.get('selectedServiceNames'));
  957. },
  958. /**
  959. * Check whether hive New MySQL database is on the same host as Ambari server MySQL server
  960. * @return {$.ajax|null}
  961. * @method checkMySQLHost
  962. */
  963. checkMySQLHost: function () {
  964. // get ambari database type and hostname
  965. return App.ajax.send({
  966. name: 'config.ambari.database.info',
  967. sender: this,
  968. success: 'getAmbariDatabaseSuccess'
  969. });
  970. },
  971. /**
  972. * Success callback for ambari database, get Ambari DB type and DB server hostname, then
  973. * Check whether hive New MySQL database is on the same host as Ambari server MySQL server
  974. * @param {object} data
  975. * @method getAmbariDatabaseSuccess
  976. */
  977. getAmbariDatabaseSuccess: function (data) {
  978. var hiveDBHostname = this.get('stepConfigs').findProperty('serviceName', 'HIVE').configs.findProperty('name', 'hivemetastore_host').value;
  979. var ambariServiceHostComponents = data.hostComponents;
  980. if (!!ambariServiceHostComponents.length) {
  981. var ambariDBInfo = JSON.stringify(ambariServiceHostComponents[0].RootServiceHostComponents.properties);
  982. this.set('mySQLServerConflict', ambariDBInfo.indexOf('mysql') > 0 && ambariDBInfo.indexOf(hiveDBHostname) > 0);
  983. } else {
  984. this.set('mySQLServerConflict', false);
  985. }
  986. },
  987. /**
  988. * Check if new MySql database was chosen for Hive service
  989. * and it is not located on the same host as Ambari server
  990. * that using MySql database too.
  991. *
  992. * @method resolveHiveMysqlDatabase
  993. **/
  994. resolveHiveMysqlDatabase: function() {
  995. var hiveService = this.get('content.services').findProperty('serviceName', 'HIVE');
  996. if (!hiveService || !hiveService.get('isSelected') || hiveService.get('isInstalled')) {
  997. this.moveNext();
  998. return;
  999. }
  1000. var hiveDBType = this.get('stepConfigs').findProperty('serviceName', 'HIVE').configs.findProperty('name', 'hive_database').value;
  1001. if (hiveDBType == 'New MySQL Database') {
  1002. var self= this;
  1003. this.checkMySQLHost().done(function () {
  1004. if (self.get('mySQLServerConflict')) {
  1005. // error popup before you can proceed
  1006. return App.ModalPopup.show({
  1007. header: Em.I18n.t('installer.step7.popup.mySQLWarning.header'),
  1008. bodyClass: Ember.View.extend({
  1009. template: Ember.Handlebars.compile(Em.I18n.t('installer.step7.popup.mySQLWarning.body'))
  1010. }),
  1011. secondary: Em.I18n.t('installer.step7.popup.mySQLWarning.button.gotostep5'),
  1012. primary: Em.I18n.t('installer.step7.popup.mySQLWarning.button.dismiss'),
  1013. onSecondary: function (){
  1014. var parent = this;
  1015. return App.ModalPopup.show({
  1016. header: Em.I18n.t('installer.step7.popup.mySQLWarning.confirmation.header'),
  1017. bodyClass: Ember.View.extend({
  1018. template: Ember.Handlebars.compile( Em.I18n.t('installer.step7.popup.mySQLWarning.confirmation.body'))
  1019. }),
  1020. onPrimary: function (){
  1021. this.hide();
  1022. parent.hide();
  1023. // go back to step 5: assign masters and disable default navigation warning
  1024. App.router.get('installerController').gotoStep(5, true);
  1025. }
  1026. });
  1027. }
  1028. });
  1029. } else {
  1030. self.moveNext();
  1031. }
  1032. });
  1033. } else {
  1034. this.moveNext();
  1035. }
  1036. },
  1037. checkDatabaseConnectionTest: function() {
  1038. var deferred = $.Deferred();
  1039. if (!App.supports.databaseConnection) {
  1040. deferred.resolve();
  1041. return deferred;
  1042. }
  1043. var configMap = [
  1044. {
  1045. serviceName: 'OOZIE',
  1046. ignored: Em.I18n.t('installer.step7.oozie.database.new')
  1047. },
  1048. {
  1049. serviceName: 'HIVE',
  1050. ignored: Em.I18n.t('installer.step7.hive.database.new')
  1051. }
  1052. ];
  1053. configMap.forEach(function(config) {
  1054. var isConnectionNotTested = false;
  1055. var service = this.get('content.services').findProperty('serviceName', config.serviceName);
  1056. if (service && service.get('isSelected') && !service.get('isInstalled')) {
  1057. var serviceConfigs = this.get('stepConfigs').findProperty('serviceName', config.serviceName).configs;
  1058. var serviceDatabase = serviceConfigs.findProperty('name', config.serviceName.toLowerCase() + '_database').get('value');
  1059. if (serviceDatabase !== config.ignored) {
  1060. var filledProperties = App.db.get('tmp', config.serviceName + '_connection');
  1061. if (!filledProperties || App.isEmptyObject(filledProperties)) {
  1062. isConnectionNotTested = true;
  1063. } else {
  1064. for (var key in filledProperties) {
  1065. if (serviceConfigs.findProperty('name', key).get('value') !== filledProperties[key])
  1066. isConnectionNotTested = true;
  1067. }
  1068. }
  1069. }
  1070. }
  1071. config.isCheckIgnored = isConnectionNotTested;
  1072. }, this);
  1073. var ignoredServices = configMap.filterProperty('isCheckIgnored', true);
  1074. if (ignoredServices.length) {
  1075. var displayedServiceNames = ignoredServices.mapProperty('serviceName').map(function(serviceName) {
  1076. return App.Service.DisplayNames[serviceName];
  1077. }, this);
  1078. this.showDatabaseConnectionWarningPopup(displayedServiceNames, deferred);
  1079. }
  1080. else {
  1081. deferred.resolve();
  1082. }
  1083. return deferred;
  1084. },
  1085. showDatabaseConnectionWarningPopup: function(serviceNames, deferred) {
  1086. return App.ModalPopup.show({
  1087. header: Em.I18n.t('installer.step7.popup.database.connection.header'),
  1088. body: Em.I18n.t('installer.step7.popup.database.connection.body').format(serviceNames.join(', ')),
  1089. secondary: Em.I18n.t('common.cancel'),
  1090. primary: Em.I18n.t('common.proceedAnyway'),
  1091. onPrimary: function() {
  1092. deferred.resolve();
  1093. this._super();
  1094. },
  1095. onSecondary: function() {
  1096. deferred.reject();
  1097. this._super();
  1098. }
  1099. })
  1100. },
  1101. /**
  1102. * Proceed to the next step
  1103. **/
  1104. moveNext: function() {
  1105. App.router.send('next');
  1106. },
  1107. /**
  1108. * Click-handler on Next button
  1109. * @method submit
  1110. */
  1111. submit: function () {
  1112. var _this = this;
  1113. if (!this.get('isSubmitDisabled')) {
  1114. this.checkDatabaseConnectionTest().done(function() {
  1115. _this.resolveHiveMysqlDatabase();
  1116. });
  1117. }
  1118. }
  1119. });