You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/01/26 22:45:44 UTC
[41/50] ambari git commit: AMBARI-14749: Introduce ADD HAWQ STANDBY
wizard to enable high availability in HAWQ (bhuvnesh2703 via jaoki)
AMBARI-14749: Introduce ADD HAWQ STANDBY wizard to enable high availability in HAWQ (bhuvnesh2703 via jaoki)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f755efc5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f755efc5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f755efc5
Branch: refs/heads/branch-dev-patch-upgrade
Commit: f755efc52bb80c5dbafbf6c63deb60a9c387f82e
Parents: ba97f13
Author: Jun Aoki <ja...@apache.org>
Authored: Mon Jan 25 16:48:41 2016 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Mon Jan 25 16:48:41 2016 -0800
----------------------------------------------------------------------
ambari-web/app/assets/test/tests.js | 1 +
ambari-web/app/controllers.js | 5 +
.../hawq/addStandby/step1_controller.js | 24 +++
.../hawq/addStandby/step2_controller.js | 35 ++++
.../hawq/addStandby/step3_controller.js | 146 +++++++++++++
.../hawq/addStandby/step4_controller.js | 90 ++++++++
.../hawq/addStandby/wizard_controller.js | 129 ++++++++++++
.../main/admin/highAvailability_controller.js | 9 +
ambari-web/app/controllers/main/service/item.js | 21 +-
.../app/data/HDP2.3/hawq_ha_properties.js | 43 ++++
ambari-web/app/data/controller_route.js | 4 +
ambari-web/app/messages.js | 32 ++-
.../mixins/wizard/assign_master_components.js | 2 +-
.../wizard/wizardProgressPageController.js | 54 +++--
ambari-web/app/models/host_component.js | 8 +
ambari-web/app/models/service.js | 3 +-
.../app/routes/add_hawq_standby_routes.js | 203 +++++++++++++++++++
ambari-web/app/routes/main.js | 2 +
.../highAvailability/hawq/addStandby/step1.hbs | 28 +++
.../highAvailability/hawq/addStandby/step3.hbs | 58 ++++++
.../highAvailability/hawq/addStandby/step4.hbs | 18 ++
.../highAvailability/hawq/addStandby/wizard.hbs | 45 ++++
.../utils/configs/hawq_ha_config_initializer.js | 52 +++++
ambari-web/app/utils/db.js | 1 +
ambari-web/app/views.js | 5 +
.../hawq/addStandby/step1_view.js | 26 +++
.../hawq/addStandby/step2_view.js | 28 +++
.../hawq/addStandby/step3_view.js | 29 +++
.../hawq/addStandby/step4_view.js | 36 ++++
.../hawq/addStandby/wizard_view.js | 74 +++++++
ambari-web/app/views/main/service/item.js | 3 +
.../hawq/addStandby/step3_controller_test.js | 189 +++++++++++++++++
32 files changed, 1373 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 2b801f0..215a754 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -70,6 +70,7 @@ var files = [
'test/controllers/main/admin/highAvailability/nameNode/step3_controller_test',
'test/controllers/main/admin/highAvailability/nameNode/step4_controller_test',
'test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test',
+ 'test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test',
'test/controllers/main/dashboard/config_history_controller_test',
'test/controllers/main/charts/heatmap_test',
'test/controllers/main/charts/heatmap_metrics/heatmap_metric_test',
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index dac6989..eed54dc 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -55,6 +55,11 @@ require('controllers/main/admin/highAvailability/resourceManager/step1_controlle
require('controllers/main/admin/highAvailability/resourceManager/step2_controller');
require('controllers/main/admin/highAvailability/resourceManager/step3_controller');
require('controllers/main/admin/highAvailability/resourceManager/step4_controller');
+require('controllers/main/admin/highAvailability/hawq/addStandby/wizard_controller');
+require('controllers/main/admin/highAvailability/hawq/addStandby/step1_controller');
+require('controllers/main/admin/highAvailability/hawq/addStandby/step2_controller');
+require('controllers/main/admin/highAvailability/hawq/addStandby/step3_controller');
+require('controllers/main/admin/highAvailability/hawq/addStandby/step4_controller');
require('controllers/main/admin/highAvailability/rangerAdmin/wizard_controller');
require('controllers/main/admin/highAvailability/rangerAdmin/step1_controller');
require('controllers/main/admin/highAvailability/rangerAdmin/step2_controller');
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step1_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step1_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step1_controller.js
new file mode 100644
index 0000000..eee197a
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step1_controller.js
@@ -0,0 +1,24 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.AddHawqStandbyWizardStep1Controller = Em.Controller.extend({
+ name: "addHawqStandbyWizardStep1Controller"
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step2_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step2_controller.js
new file mode 100644
index 0000000..d99708c
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step2_controller.js
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.AddHawqStandbyWizardStep2Controller = Em.Controller.extend(App.BlueprintMixin, App.AssignMasterComponents, {
+
+ name: "addHawqStandbyWizardStep2Controller",
+
+ useServerValidation: true,
+
+ mastersToShow: ['HAWQMASTER', 'HAWQSTANDBY'],
+
+ mastersToAdd: ['HAWQSTANDBY'],
+
+ showCurrentPrefix: ['HAWQMASTER'],
+
+ showInstalledMastersFirst: true
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller.js
new file mode 100644
index 0000000..0cb256d
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller.js
@@ -0,0 +1,146 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @typedef {object} hawqHaConfigDependencies
+ */
+
+var App = require('app');
+require('utils/configs/hawq_ha_config_initializer');
+
+App.AddHawqStandbyWizardStep3Controller = Em.Controller.extend({
+ name: "addHawqStandbyWizardStep3Controller",
+
+ // Used in service_config.hbs
+ // selectedService
+ // hideDependenciesInfoBar
+ // versionLoaded
+
+ selectedService: null,
+
+ hideDependenciesInfoBar: true,
+
+ versionLoaded: true,
+
+ // Used in step3.hbs
+ // isLoaded
+ // isSubmitDisabled
+ // hawqMasterDirectoryCleanUpMessage
+ isLoaded: false,
+
+ isSubmitDisabled: Em.computed.not('isLoaded'),
+
+ loadStep: function () {
+ this.renderConfigs();
+ },
+
+ content: Em.Object.create({
+ controllerName: 'addHawqStandbyWizardStep3Controller'
+ }),
+
+ /**
+ * Render configs to show them in <code>App.ServiceConfigView</code>
+ */
+ renderConfigs: function () {
+
+ var configs = require('data/HDP2.3/hawq_ha_properties').haConfig;
+
+ var serviceConfig = App.ServiceConfig.create({
+ serviceName: configs.serviceName,
+ displayName: configs.displayName,
+ configCategories: [],
+ showConfig: true,
+
+ configs: []
+ });
+
+ configs.configCategories.forEach(function (configCategory) {
+ if (App.Service.find().someProperty('serviceName', configCategory.name)) {
+ serviceConfig.configCategories.pushObject(configCategory);
+ }
+ }, this);
+
+ this.renderConfigProperties(configs, serviceConfig);
+ App.ajax.send({
+ name: 'config.tags',
+ sender: this,
+ success: 'loadConfigTagsSuccessCallback',
+ error: '',
+ data: {
+ serviceConfig: serviceConfig
+ }
+ });
+
+ },
+
+ loadConfigTagsSuccessCallback: function (data, opt, params) {
+ var urlParams = '(type=hawq-site&tag=' + data.Clusters.desired_configs['hawq-site'].tag + ')';
+ App.ajax.send({
+ name: 'reassign.load_configs',
+ sender: this,
+ data: {
+ urlParams: urlParams,
+ serviceConfig: params.serviceConfig
+ },
+ success: 'loadConfigsSuccessCallback',
+ error: 'loadConfigsSuccessCallback'
+ });
+ },
+
+ loadConfigsSuccessCallback: function (data, opt, params) {
+ params = params.serviceConfig ? params.serviceConfig : {};
+ this.setDynamicConfigValues(params, data);
+ this.setProperties({
+ selectedService: params,
+ isLoaded: true
+ });
+ },
+
+ setDynamicConfigValues: function (configs, data) {
+ var topologyLocalDB = this.get('content').getProperties(['masterComponentHosts']);
+ configs.configs.forEach(function (config) {
+ App.HawqHaConfigInitializer.initialValue(config, topologyLocalDB);
+ });
+ App.HawqHaConfigInitializer.cleanup();
+ return configs;
+ },
+
+ /**
+ * Load child components to service config object
+ * @param _componentConfig
+ * @param componentConfig
+ */
+ renderConfigProperties: function (_componentConfig, componentConfig) {
+ _componentConfig.configs.forEach(function (_serviceConfigProperty) {
+ var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
+ componentConfig.configs.pushObject(serviceConfigProperty);
+ serviceConfigProperty.set('isEditable', serviceConfigProperty.get('isReconfigurable'));
+ serviceConfigProperty.validate();
+ }, this);
+ },
+
+ submit: function () {
+ if (!this.get('isSubmitDisabled')) {
+ App.get('router.mainAdminKerberosController').getKDCSessionState(function() {
+ App.router.send("next");
+ });
+ }
+ },
+
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js
new file mode 100644
index 0000000..6d78947
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js
@@ -0,0 +1,90 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+require('controllers/main/admin/serviceAccounts_controller');
+
+App.AddHawqStandbyWizardStep4Controller = App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
+
+ name: "addHawqStandbyWizardStep4Controller",
+
+ clusterDeployState: 'ADD_HAWQ_STANDBY',
+
+ commands: ['stopRequiredServices', 'installHawqStandbyMaster', 'reconfigureHAWQ', 'startRequiredServices'],
+
+ tasksMessagesPrefix: 'admin.addHawqStandby.wizard.step',
+
+ stopRequiredServices: function () {
+ this.stopServices(['HAWQ'], true);
+ },
+
+ installHawqStandbyMaster: function () {
+ var hostName = this.get('content.hawqHosts.newHawqStandby');
+ this.createComponent('HAWQSTANDBY', hostName, "HAWQ");
+ },
+
+ reconfigureHAWQ: function () {
+ App.ajax.send({
+ name: 'config.tags',
+ sender: this,
+ success: 'onLoadHawqConfigsTags',
+ error: 'onTaskError'
+ });
+ },
+
+ onLoadHawqConfigsTags: function (data) {
+ App.ajax.send({
+ name: 'reassign.load_configs',
+ sender: this,
+ data: {
+ urlParams: '(type=hawq-site&tag=' + data.Clusters.desired_configs['hawq-site'].tag + ')',
+ type: 'hawq-site'
+ },
+ success: 'onLoadConfigs',
+ error: 'onTaskError'
+ });
+ },
+
+ onLoadConfigs: function (data, opt, params) {
+ var propertiesToAdd = this.get('content.configs').filterProperty('filename', params.type);
+ propertiesToAdd.forEach(function (property) {
+ data.items[0].properties[property.name] = property.value;
+ });
+
+ var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.addHawqStandby.step4.save.configuration.note').format(App.format.role('HAWQSTANDBY')));
+
+ App.ajax.send({
+ name: 'common.service.configurations',
+ sender: this,
+ data: {
+ desired_config: configData
+ },
+ success: 'onSaveConfigs',
+ error: 'onTaskError'
+ });
+ },
+ onSaveConfigs: function () {
+ this.onTaskCompleted();
+ },
+
+ startRequiredServices: function () {
+ this.startServices(true, ["HAWQ"], true);
+ }
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/wizard_controller.js
new file mode 100644
index 0000000..1c4325e
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/wizard_controller.js
@@ -0,0 +1,129 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.AddHawqStandbyWizardController = App.WizardController.extend({
+
+ name: 'addHawqStandbyWizardController',
+
+ totalSteps: 4,
+
+ /**
+ * @type {string}
+ */
+ displayName: Em.I18n.t('admin.addHawqStandby.wizard.header'),
+
+ isFinished: false,
+
+ content: Em.Object.create({
+ controllerName: 'addHawqStandbyWizardController'
+ }),
+
+ init: function () {
+ this._super();
+ this.clearStep();
+ },
+
+ clearStep: function () {
+ this.set('isFinished', false);
+ },
+
+ setCurrentStep: function (currentStep, completed) {
+ this._super(currentStep, completed);
+ App.clusterStatus.setClusterStatus({
+ clusterName: this.get('content.cluster.name'),
+ wizardControllerName: 'addHawqStandbyWizardController',
+ localdb: App.db.data
+ });
+ },
+
+ /**
+ * Save hosts for hawq master and hawq standby to local db and <code>controller.content</code>
+ * @param rmHosts
+ */
+ saveHawqHosts: function (hawqHosts) {
+ this.set('content.hawqHosts', hawqHosts);
+ this.setDBProperty('hawqHosts', hawqHosts);
+ },
+
+ /**
+ * Load hosts for hawq master and hawq standby from local db to <code>controller.content</code>
+ */
+ loadHawqHosts: function() {
+ this.set('content.hawqHosts', this.getDBProperty('hawqHosts'));
+ },
+
+ /**
+ * Save configs to load and apply them on Configure Components step
+ * @param configs
+ */
+ saveConfigs: function (configs) {
+ this.set('content.configs', configs);
+ this.setDBProperty('configs', configs);
+ },
+
+ /**
+ * Load configs to apply them on Configure Components step
+ */
+ loadConfigs: function() {
+ this.set('content.configs', this.getDBProperty('configs'));
+ },
+
+ /**
+ * Load data for all steps until <code>current step</code>
+ */
+ loadAllPriorSteps: function () {
+ var step = this.get('currentStep');
+ switch (step) {
+ case '4':
+ this.loadTasksStatuses();
+ this.loadTasksRequestIds();
+ this.loadRequestIds();
+ this.loadConfigs();
+ case '3':
+ case '2':
+ this.loadHawqHosts();
+ this.loadServicesFromServer();
+ this.loadMasterComponentHosts();
+ this.loadConfirmedHosts();
+ case '1':
+ this.load('cluster');
+ }
+ },
+
+ /**
+ * Remove all loaded data.
+ */
+ clearAllSteps: function () {
+ this.clearInstallOptions();
+ // clear temporary information stored during the install
+ this.set('content.cluster', this.getCluster());
+ },
+
+ /**
+ * Clear all temporary data
+ */
+ finish: function () {
+ this.resetDbNamespace();
+ App.router.get('updateController').updateAll();
+ this.set('isFinished', true);
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/controllers/main/admin/highAvailability_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 9fe9bbb..29ce167 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -78,6 +78,15 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({
},
/**
+ * add Hawq Standby
+ * @return {Boolean}
+ */
+ addHawqStandby: function () {
+ App.router.transitionTo('main.services.addHawqStandby');
+ return true;
+ },
+
+ /**
* enable Ranger Admin High Availability
* @return {Boolean}
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 14552a1..406d940 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -903,23 +903,28 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
}.property('content.serviceName'),
enableHighAvailability: function() {
- var ability_controller = App.router.get('mainAdminHighAvailabilityController');
- ability_controller.enableHighAvailability();
+ var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
+ highAvailabilityController.enableHighAvailability();
},
disableHighAvailability: function() {
- var ability_controller = App.router.get('mainAdminHighAvailabilityController');
- ability_controller.disableHighAvailability();
+ var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
+ highAvailabilityController.disableHighAvailability();
},
enableRMHighAvailability: function() {
- var ability_controller = App.router.get('mainAdminHighAvailabilityController');
- ability_controller.enableRMHighAvailability();
+ var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
+ highAvailabilityController.enableRMHighAvailability();
+ },
+
+ addHawqStandby: function() {
+ var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
+ highAvailabilityController.addHawqStandby();
},
enableRAHighAvailability: function() {
- var ability_controller = App.router.get('mainAdminHighAvailabilityController');
- ability_controller.enableRAHighAvailability();
+ var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
+ highAvailabilityController.enableRAHighAvailability();
},
downloadClientConfigs: function (event) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/data/HDP2.3/hawq_ha_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2.3/hawq_ha_properties.js b/ambari-web/app/data/HDP2.3/hawq_ha_properties.js
new file mode 100644
index 0000000..62deba3
--- /dev/null
+++ b/ambari-web/app/data/HDP2.3/hawq_ha_properties.js
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+module.exports =
+{
+ "haConfig": {
+ serviceName: 'MISC',
+ displayName: 'MISC',
+ configCategories: [
+ App.ServiceConfigCategory.create({name: 'HAWQ', displayName: 'HAWQ'}),
+ ],
+ sites: ['hawq-site'],
+ configs: [
+ /**********************************************HAWQ***************************************/
+ {
+ "name": "hawq_standby_address_host",
+ "displayName": "HAWQ Standby Master",
+ "isReconfigurable": false,
+ "recommendedValue": "",
+ "isOverridable": false,
+ "value": "",
+ "category": "HAWQ",
+ "filename": "hawq-site",
+ serviceName: 'MISC'
+ },
+ ]
+ }
+};
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/data/controller_route.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/controller_route.js b/ambari-web/app/data/controller_route.js
index dea5ace..15e89a6 100644
--- a/ambari-web/app/data/controller_route.js
+++ b/ambari-web/app/data/controller_route.js
@@ -50,6 +50,10 @@ module.exports = [
route: 'main.services.enableRMHighAvailability'
},
{
+ wizardControllerName: App.router.get('addHawqStandbyWizardController.name'),
+ route: 'main.services.addHawqStandby'
+ },
+ {
wizardControllerName: App.router.get('rAHighAvailabilityWizardController.name'),
route: 'main.services.enableRAHighAvailability'
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 34107f6..f9f389c 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2867,5 +2867,35 @@ Em.I18n.translations = {
'wizard.inProgress': '{0} in Progress',
- 'alerts.instance.fullLogPopup.header': 'Instance Response'
+ 'alerts.instance.fullLogPopup.header': 'Instance Response',
+ 'admin.addHawqStandby.button.enable': 'Add HAWQ Standby Master',
+ 'admin.addHawqStandby.closePopup':'Add HAWQ Standby Master Wizard is in progress. You must allow the wizard to' +
+ ' complete for Ambari to be in usable state. If you choose to quit, you must follow documented manual' +
+ ' instructions to complete or reverting adding HAWQ Standby Master. Are you sure you want to exit the wizard?',
+ 'admin.addHawqStandby.wizard.header': 'Add HAWQ Standby Master Wizard',
+ 'admin.addHawqStandby.wizard.step1.header': 'Get Started',
+ 'admin.addHawqStandby.wizard.step1.body':'This wizard will walk you through adding a HAWQ Standby Master to your cluster.<br/>' +
+ 'Once added, you will be running a HAWQ Standby Master in addition to the current HAWQ Master.<br/>' +
+ 'This allows for Active-Standby HAWQ configuration that can be used to perform a manual failover.<br/><br/>' +
+ '<b>You should plan a cluster maintenance window and prepare for cluster downtime when adding HAWQ Standby' +
+ ' Master. HAWQ cluster will be stopped and started during the process. </b><br/><br/>',
+ 'admin.addHawqStandby.wizard.step2.header': 'Select Host',
+ 'admin.addHawqStandby.wizard.step2.body': 'Select a host that will be running the HAWQ Standby Master',
+ 'admin.addHawqStandby.wizard.step3.header': 'Review',
+ 'admin.addHawqStandby.wizard.step3.configs_changes': 'Review Configuration Changes.',
+ 'admin.addHawqStandby.wizard.step3.confirm.host.body':'<b>Confirm your host selections.</b>',
+ 'admin.addHawqStandby.wizard.step3.confirm.config.body':'<div class="alert alert-info">' +
+ '<b>Review Configuration Changes.</b></br>' +
+ 'The following lists the configuration changes that will be made by the Wizard to add HAWQ Standby Master. This information is for <b> review only </b> and is not editable.' +
+ '</div>',
+ 'admin.addHawqStandby.wizard.step3.hawqMaster': 'Current HAWQ Master',
+ 'admin.addHawqStandby.wizard.step3.newHawqStandby': 'New HAWQ Standby Master',
+ 'admin.addHawqStandby.step4.save.configuration.note': 'This configuration is created by Add HAWQ Standby wizard',
+ 'admin.addHawqStandby.wizard.step4.header': 'Configure Components',
+ 'admin.addHawqStandby.wizard.step4.task0.title': 'Stop HAWQ Service',
+ 'admin.addHawqStandby.wizard.step4.task1.title': 'Install HAWQ Standby Master',
+ 'admin.addHawqStandby.wizard.step4.task2.title': 'Reconfigure HAWQ',
+ 'admin.addHawqStandby.wizard.step4.task3.title': 'Start HAWQ Service',
+ 'admin.addHawqStandby.wizard.step4.notice.inProgress':'Please wait while HAWQ Standby Master is being deployed.',
+ 'admin.addHawqStandby.wizard.step4.notice.completed':'HAWQ Standby Master has been enabled successfully.'
};
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/mixins/wizard/assign_master_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js
index b1b2d9b..0693507 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -307,7 +307,7 @@ App.AssignMasterComponents = Em.Mixin.create({
/**
* Update submit button status
- * @metohd updateIsSubmitDisabled
+ * @method updateIsSubmitDisabled
*/
updateIsSubmitDisabled: function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/mixins/wizard/wizardProgressPageController.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
index d9c5747..02cd36a 100644
--- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js
+++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
@@ -405,27 +405,34 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, {
},
/**
- * make server call to stop all services, except <code>excludedServices</code>
- * @param excludedServices
+ * make server call to stop services
+ * if stopListedServicesFlag == false; stop all services excluding the services passed as parameters
+ * if stopListedServicesFlag == true; stop only services passed as parameters
+ * if no parameters are passed; stop all services
+ * @param services, stopListedServicesFlag
* @returns {$.ajax}
*/
- stopServices: function (excludedServices) {
+ stopServices: function (services, stopListedServicesFlag) {
+ var stopListedServicesFlag = stopListedServicesFlag || false;
var data = {
'ServiceInfo': {
'state': 'INSTALLED'
}
};
-
- if (excludedServices && excludedServices.length) {
- var servicesList = App.Service.find().mapProperty("serviceName").filter(function (s) {
- return !excludedServices.contains(s)
- }).join(',');
+ if (services && services.length) {
+ var servicesList;
+ if (stopListedServicesFlag) {
+ servicesList = services.join(',');
+ } else {
+ servicesList = App.Service.find().mapProperty("serviceName").filter(function (s) {
+ return !services.contains(s)
+ }).join(',');
+ }
data.context = "Stop required services";
data.urlParams = "ServiceInfo/service_name.in(" + servicesList + ")";
} else {
data.context = "Stop all services";
}
-
return App.ajax.send({
name: 'common.services.update',
sender: this,
@@ -435,25 +442,34 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, {
});
},
- /**
- * make server call to start all services, except <code>excludedServices</code>
- * and run smoke tests if <code>runSmokeTest</code> is true
+ /*tep4
+ * make server call to start services
+ * if startListedServicesFlag == false; start all services excluding the services passed as parameters
+ * if startListedServicesFlag == true; start only services passed as parameters
+ * if no parameters are passed; start all services
+ * and run smoke tests if runSmokeTest is true
* @param runSmokeTest
- * @param excludedServices
+ * @param services
+ * @param startListedServicesFlag
* @returns {$.ajax}
*/
- startServices: function (runSmokeTest, excludedServices) {
+ startServices: function (runSmokeTest, services, startListedServicesFlag) {
+ var startListedServicesFlag = startListedServicesFlag || false;
var skipServiceCheck = App.router.get('clusterController.ambariProperties')['skip.service.checks'] === "true";
var data = {
'ServiceInfo': {
'state': 'STARTED'
}
};
-
- if (excludedServices && excludedServices.length) {
- var servicesList = App.Service.find().mapProperty("serviceName").filter(function (s) {
- return !excludedServices.contains(s)
- }).join(',');
+ var servicesList;
+ if (services && services.length) {
+ if (startListedServicesFlag) {
+ servicesList = services.join(',');
+ } else {
+ servicesList = App.Service.find().mapProperty("serviceName").filter(function (s) {
+ return !services.contains(s)
+ }).join(',');
+ }
data.context = "Start required services";
data.urlParams = "ServiceInfo/service_name.in(" + servicesList + ")";
} else {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/models/host_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js
index 0c013b1..5008277 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -263,6 +263,7 @@ App.HostComponentActionMap = {
var NN = ctx.get('controller.content.hostComponents').findProperty('componentName', 'NAMENODE');
var RM = ctx.get('controller.content.hostComponents').findProperty('componentName', 'RESOURCEMANAGER');
var RA = ctx.get('controller.content.hostComponents').findProperty('componentName', 'RANGER_ADMIN');
+ var HS = ctx.get('controller.content.hostComponents').findProperty('componentName', 'HAWQSTANDBY');
return {
RESTART_ALL: {
action: 'restartAllHostComponents',
@@ -390,6 +391,13 @@ App.HostComponentActionMap = {
context: ctx.get('serviceName'),
label: Em.I18n.t('common.delete'),
cssClass: 'icon-remove'
+ },
+ TOGGLE_ADD_HAWQ_STANDBY: {
+ action: 'addHawqStandby',
+ label: Em.I18n.t('admin.addHawqStandby.button.enable'),
+ cssClass: 'icon-plus',
+ isHidden: App.get('isSingleNode') || HS,
+ disabled: false
}
};
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/models/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index 27647a0..eba0fe9 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -86,7 +86,8 @@ App.Service = DS.Model.extend({
GANGLIA: ['MONITORING'],
HDFS: ['HA_MODE'],
YARN: ['HA_MODE'],
- RANGER: ['HA_MODE']
+ RANGER: ['HA_MODE'],
+ HAWQ: ['HA_MODE']
};
return typeServiceMap[this.get('serviceName')] || [];
}.property('serviceName'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/routes/add_hawq_standby_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_hawq_standby_routes.js b/ambari-web/app/routes/add_hawq_standby_routes.js
new file mode 100644
index 0000000..9748ede
--- /dev/null
+++ b/ambari-web/app/routes/add_hawq_standby_routes.js
@@ -0,0 +1,203 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+module.exports = App.WizardRoute.extend({
+ route: '/highAvailability/Hawq/add',
+
+ enter: function (router, transition) {
+ var addHawqStandbyWizardController = router.get('addHawqStandbyWizardController');
+ addHawqStandbyWizardController.dataLoading().done(function () {
+ //Set HAWQ as current service
+ App.router.set('mainServiceItemController.content', App.Service.find().findProperty('serviceName', 'HAWQ'));
+ App.router.get('updateController').set('isWorking', false);
+ var popup = App.ModalPopup.show({
+ classNames: ['full-width-modal'],
+ header: Em.I18n.t('admin.addHawqStandby.wizard.header'),
+ bodyClass: App.AddHawqStandbyWizardView.extend({
+ controller: addHawqStandbyWizardController
+ }),
+ primary: Em.I18n.t('form.cancel'),
+ showFooter: false,
+ secondary: null,
+ updateClusterStatus: function() {
+ var controller = router.get('addHawqStandbyWizardController');
+ router.get('updateController').set('isWorking', true);
+ addHawqStandbyWizardController.finish();
+ App.clusterStatus.setClusterStatus({
+ clusterName: App.router.getClusterName(),
+ clusterState: 'DEFAULT',
+ localdb: App.db.data
+ }, {
+ alwaysCallback: function () {
+ controller.get('popup').hide();
+ router.transitionTo('main.services.index');
+ Em.run.next(function() {
+ location.reload();
+ });
+ }
+ });
+ },
+
+ onClose: function () {
+ var addHawqStandbyWizardController = router.get('addHawqStandbyWizardController'),
+ currStep = addHawqStandbyWizardController.get('currentStep'),
+ self = this;
+
+ if (parseInt(currStep) === 4) {
+ App.showConfirmationPopup(function () {
+ popup.updateClusterStatus();
+ }, Em.I18n.t('admin.addHawqStandby.closePopup'));
+ } else {
+ popup.updateClusterStatus();
+ }
+ },
+ didInsertElement: function () {
+ this.fitHeight();
+ }
+ });
+ addHawqStandbyWizardController.set('popup', popup);
+ var currentClusterStatus = App.clusterStatus.get('value');
+ switch (currentClusterStatus.clusterState) {
+ case 'ADD_HAWQ_STANDBY' :
+ addHawqStandbyWizardController.setCurrentStep(currentClusterStatus.localdb.AddHawqStandbyWizard.currentStep);
+ break;
+ default:
+ var currStep = App.router.get('addHawqStandbyWizardController.currentStep');
+ addHawqStandbyWizardController.setCurrentStep(currStep);
+ break;
+ }
+ Em.run.next(function () {
+ App.router.get('wizardWatcherController').setUser(addHawqStandbyWizardController.get('name'));
+ router.transitionTo('step' + addHawqStandbyWizardController.get('currentStep'));
+ });
+ });
+ },
+
+ step1: Em.Route.extend({
+ route: '/step1',
+ connectOutlets: function (router) {
+ var controller = router.get('addHawqStandbyWizardController');
+ controller.dataLoading().done(function () {
+ controller.setCurrentStep('1');
+ controller.connectOutlet('addHawqStandbyWizardStep1', controller.get('content'));
+ })
+ },
+ unroutePath: function () {
+ return false;
+ },
+ next: function (router) {
+ var controller = router.get('addHawqStandbyWizardController');
+ controller.setDBProperty('hawqHosts', undefined);
+ controller.clearMasterComponentHosts();
+ router.transitionTo('step2');
+ }
+ }),
+
+ step2: Em.Route.extend({
+ route: '/step2',
+ connectOutlets: function (router) {
+ var controller = router.get('addHawqStandbyWizardController');
+ controller.dataLoading().done(function () {
+ controller.setCurrentStep('2');
+ controller.loadAllPriorSteps();
+ controller.connectOutlet('addHawqStandbyWizardStep2', controller.get('content'));
+ })
+ },
+ unroutePath: function () {
+ return false;
+ },
+ next: function (router) {
+ var controller = router.get('addHawqStandbyWizardController');
+ var stepController = router.get('addHawqStandbyWizardStep2Controller');
+ var hawqHost = {
+ hawqMaster : stepController.get('servicesMasters').filterProperty('component_name', 'HAWQMASTER').findProperty('isInstalled', true).get('selectedHost'),
+ newHawqStandby : stepController.get('servicesMasters').filterProperty('component_name', 'HAWQSTANDBY').findProperty('isInstalled', false).get('selectedHost')
+ };
+ controller.saveHawqHosts(hawqHost);
+ controller.saveMasterComponentHosts(stepController);
+ router.transitionTo('step3');
+ },
+ back: function (router) {
+ router.transitionTo('step1');
+ }
+ }),
+
+ step3: Em.Route.extend({
+ route: '/step3',
+ connectOutlets: function (router) {
+ var controller = router.get('addHawqStandbyWizardController');
+ controller.dataLoading().done(function () {
+ controller.setCurrentStep('3');
+ controller.loadAllPriorSteps();
+ controller.connectOutlet('addHawqStandbyWizardStep3', controller.get('content'));
+ })
+ },
+ unroutePath: function () {
+ return false;
+ },
+ next: function (router) {
+ var controller = router.get('addHawqStandbyWizardController');
+ var stepController = router.get('addHawqStandbyWizardStep3Controller');
+ var configs = stepController.get('selectedService.configs');
+ controller.saveConfigs(configs);
+ router.transitionTo('step4');
+ },
+ back: Em.Router.transitionTo('step2')
+ }),
+
+ step4: Em.Route.extend({
+ route: '/step4',
+ connectOutlets: function (router) {
+ var controller = router.get('addHawqStandbyWizardController');
+ controller.dataLoading().done(function () {
+ controller.setCurrentStep('4');
+ controller.setLowerStepsDisable(4);
+ controller.loadAllPriorSteps();
+ controller.connectOutlet('addHawqStandbyWizardStep4', controller.get('content'));
+ })
+ },
+ unroutePath: function (router, path) {
+ // allow user to leave route if wizard has finished
+ if (router.get('addHawqStandbyWizardController').get('isFinished')) {
+ this._super(router, path);
+ } else {
+ return false;
+ }
+ },
+ next: function (router) {
+ var controller = router.get('addHawqStandbyWizardController');
+ controller.finish();
+ App.clusterStatus.setClusterStatus({
+ clusterName: controller.get('content.cluster.name'),
+ clusterState: 'DEFAULT',
+ localdb: App.db.data
+ }, {
+ alwaysCallback: function () {
+ controller.get('popup').hide();
+ router.transitionTo('main.services.index');
+ Em.run.next(function () {
+ location.reload();
+ });
+ }
+ });
+ }
+ })
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 4a78970..48c9b91 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -717,6 +717,8 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
enableRAHighAvailability: require('routes/ra_high_availability_routes'),
+ addHawqStandby: require('routes/add_hawq_standby_routes'),
+
rollbackHighAvailability: require('routes/rollbackHA_routes')
}),
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step1.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step1.hbs b/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step1.hbs
new file mode 100644
index 0000000..2e315e3
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step1.hbs
@@ -0,0 +1,28 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+<div>
+ <h2>{{t admin.addHawqStandby.wizard.step1.header}}</h2>
+
+ <div class="alert alert-info">
+ {{t admin.addHawqStandby.wizard.step1.body}}
+ </div>
+
+ <div class="btn-area">
+ <a class="btn btn-success pull-right" {{action next}}>{{t common.next}} →</a>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step3.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step3.hbs b/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step3.hbs
new file mode 100644
index 0000000..ac1fabf
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step3.hbs
@@ -0,0 +1,58 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+<h2>{{t admin.addHawqStandby.wizard.step3.header}}</h2>
+
+<div class="alert alert-info">
+ {{t admin.addHawqStandby.wizard.step3.confirm.host.body}}
+</div>
+
+<div id="ha-step3-content" class="well pre-scrollable">
+ <div id="step8-info">
+ <table id="ha-step3-review-table">
+ <tr>
+ <td>
+ <b>{{t admin.addHawqStandby.wizard.step3.hawqMaster}}</b>:
+ </td>
+ <td>{{controller.content.hawqHosts.hawqMaster}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>
+ <b>{{t admin.addHawqStandby.wizard.step3.newHawqStandby}}</b>:
+ </td>
+ <td>{{controller.content.hawqHosts.newHawqStandby}}</td>
+ <td><span class="to-be-installed-green"><i class="icon-plus"></i> {{t admin.highAvailability.wizard.step3.toBeInstalled}}</span></td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+{{#if controller.isLoaded}}
+ <div id="serviceConfig">
+ {{{t admin.addHawqStandby.wizard.step3.confirm.config.body}}}
+
+ {{view App.ServiceConfigView}}
+ </div>
+{{else}}
+ {{view App.SpinnerView}}
+{{/if}}
+
+<div class="btn-area">
+ <a class="btn" {{action back}}>← {{t common.back}}</a>
+ <a class="btn btn-success pull-right" {{action submit target="controller"}} {{bindAttr disabled="controller.isSubmitDisabled"}}>{{t common.next}} →</a>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step4.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step4.hbs b/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step4.hbs
new file mode 100644
index 0000000..08dc3b9
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/step4.hbs
@@ -0,0 +1,18 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+{{template "templates/common/progress"}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/wizard.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/wizard.hbs b/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/wizard.hbs
new file mode 100644
index 0000000..a859d37
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/hawq/addStandby/wizard.hbs
@@ -0,0 +1,45 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div id="hawq-ha-wizard" class="wizard">
+ <div class="container">
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span3">
+ <!--Sidebar content-->
+ <div class="well">
+ <ul class="nav nav-pills nav-stacked">
+ <li class="nav-header">{{t admin.addHawqStandby.wizard.header}}</li>
+ <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep1 target="controller"}}>{{t admin.addHawqStandby.wizard.step1.header}}</a></li>
+ <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep2 target="controller"}}>{{t admin.addHawqStandby.wizard.step2.header}}</a></li>
+ <li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep3 target="controller"}}>{{t admin.addHawqStandby.wizard.step3.header}}</a></li>
+ <li {{bindAttr class="isStep4:active view.isStep4Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep4 target="controller"}}>{{t admin.addHawqStandby.wizard.step4.header}}</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="wizard-content well span9">
+ {{#if view.isLoaded}}
+ {{outlet}}
+ {{else}}
+ {{view App.SpinnerView}}
+ {{/if}}
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/utils/configs/hawq_ha_config_initializer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/hawq_ha_config_initializer.js b/ambari-web/app/utils/configs/hawq_ha_config_initializer.js
new file mode 100644
index 0000000..1de2551
--- /dev/null
+++ b/ambari-web/app/utils/configs/hawq_ha_config_initializer.js
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+require('utils/configs/config_initializer_class');
+require('utils/configs/hosts_based_initializer_mixin');
+
+/**
+ * Initializer for configs that are updated when Hawq Standby is activated
+ *
+ * @class {HawqHaConfigInitializer}
+ */
+App.HawqHaConfigInitializer = App.HaConfigInitializerClass.create(App.HostsBasedInitializerMixin, {
+
+ initializers: function () {
+ return {
+ 'hawq_standby_address_host': this.getHostWithPortConfig('HAWQSTANDBY', false, '', '', '')
+ };
+ }.property(),
+
+ /**
+ * @override
+ * @param {object} settings
+ */
+ setup: function (settings) {
+ this._updateInitializers(settings);
+ },
+
+ /**
+ * @override
+ */
+ cleanup: function () {
+ this._restoreInitializers();
+ }
+
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/utils/db.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js
index 858675f..598910a 100644
--- a/ambari-web/app/utils/db.js
+++ b/ambari-web/app/utils/db.js
@@ -43,6 +43,7 @@ var InitialData = {
},
'HighAvailabilityWizard': {},
'RMHighAvailabilityWizard': {},
+ 'AddHawqStandbyWizard': {},
'RAHighAvailabilityWizard': {},
'RollbackHighAvailabilityWizard': {},
'MainAdminStackAndUpgrade': {},
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index e28f797..78b79b4 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -156,6 +156,11 @@ require('views/main/admin/highAvailability/resourceManager/step1_view');
require('views/main/admin/highAvailability/resourceManager/step2_view');
require('views/main/admin/highAvailability/resourceManager/step3_view');
require('views/main/admin/highAvailability/resourceManager/step4_view');
+require('views/main/admin/highAvailability/hawq/addStandby/wizard_view');
+require('views/main/admin/highAvailability/hawq/addStandby/step1_view');
+require('views/main/admin/highAvailability/hawq/addStandby/step2_view');
+require('views/main/admin/highAvailability/hawq/addStandby/step3_view');
+require('views/main/admin/highAvailability/hawq/addStandby/step4_view');
require('views/main/admin/highAvailability/rangerAdmin/wizard_view');
require('views/main/admin/highAvailability/rangerAdmin/step1_view');
require('views/main/admin/highAvailability/rangerAdmin/step2_view');
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step1_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step1_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step1_view.js
new file mode 100644
index 0000000..904ef60
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step1_view.js
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.AddHawqStandbyWizardStep1View = Em.View.extend({
+
+ templateName: require('templates/main/admin/highAvailability/hawq/addStandby/step1')
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step2_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step2_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step2_view.js
new file mode 100644
index 0000000..749c270
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step2_view.js
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.AddHawqStandbyWizardStep2View = App.AssignMasterComponentsView.extend({
+
+ title: Em.I18n.t('admin.addHawqStandby.wizard.step2.header'),
+
+ alertMessage: Em.I18n.t('admin.addHawqStandby.wizard.step2.body')
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step3_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step3_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step3_view.js
new file mode 100644
index 0000000..2102af7
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step3_view.js
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.AddHawqStandbyWizardStep3View = Em.View.extend({
+
+ templateName: require('templates/main/admin/highAvailability/hawq/addStandby/step3'),
+
+ didInsertElement: function () {
+ this.get('controller').loadStep();
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step4_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step4_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step4_view.js
new file mode 100644
index 0000000..d57f7cb
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/step4_view.js
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.AddHawqStandbyWizardStep4View = App.HighAvailabilityProgressPageView.extend({
+
+ templateName: require('templates/main/admin/highAvailability/hawq/addStandby/step4'),
+
+ headerTitle: Em.I18n.t('admin.addHawqStandby.wizard.step4.header'),
+
+ noticeInProgress: Em.I18n.t('admin.addHawqStandby.wizard.step4.notice.inProgress'),
+
+ noticeCompleted: Em.I18n.t('admin.addHawqStandby.wizard.step4.notice.completed'),
+
+ submitButtonText: Em.I18n.t('common.complete'),
+
+ labelWidth: 'span5'
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/wizard_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/wizard_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/wizard_view.js
new file mode 100644
index 0000000..def93f3
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/addStandby/wizard_view.js
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.AddHawqStandbyWizardView = Em.View.extend(App.WizardMenuMixin, {
+
+ didInsertElement: function() {
+ var currentStep = this.get('controller.currentStep');
+ if (currentStep > 3) {
+ this.get('controller').setLowerStepsDisable(currentStep);
+ }
+ },
+
+ templateName: require('templates/main/admin/highAvailability/hawq/addStandby/wizard'),
+
+ isLoaded: false,
+
+ willInsertElement: function() {
+ this.set('isLoaded', false);
+ this.loadHosts();
+ },
+
+ /**
+ * load hosts from server
+ */
+ loadHosts: function () {
+ App.ajax.send({
+ name: 'hosts.high_availability.wizard',
+ data: {},
+ sender: this,
+ success: 'loadHostsSuccessCallback',
+ error: 'loadHostsErrorCallback'
+ });
+ },
+
+ loadHostsSuccessCallback: function (data, opt, params) {
+ var hosts = {};
+
+ data.items.forEach(function (item) {
+ hosts[item.Hosts.host_name] = {
+ name: item.Hosts.host_name,
+ cpu: item.Hosts.cpu_count,
+ memory: item.Hosts.total_mem,
+ disk_info: item.Hosts.disk_info,
+ bootStatus: "REGISTERED",
+ isInstalled: true
+ };
+ });
+ App.db.setHosts(hosts);
+ this.set('controller.content.hosts', hosts);
+ this.set('isLoaded', true);
+ },
+
+ loadHostsErrorCallback: function(){
+ this.set('isLoaded', true);
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index 659a0a5..048c163 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -169,6 +169,9 @@ App.MainServiceItemView = Em.View.extend({
case 'RANGER':
options.push(actionMap.TOGGLE_RA_HA);
break;
+ case 'HAWQ':
+ options.push(actionMap.TOGGLE_ADD_HAWQ_STANDBY);
+ break;
}
}
if (serviceCheckSupported) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f755efc5/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js
new file mode 100644
index 0000000..af1937f
--- /dev/null
+++ b/ambari-web/test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test.js
@@ -0,0 +1,189 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+require('controllers/main/admin/highAvailability/hawq/addStandby/step3_controller');
+var testHelpers = require('test/helpers');
+
+describe('App.AddHawqStandbyWizardStep3Controller', function () {
+
+ describe('#isSubmitDisabled', function () {
+
+ var controller = App.AddHawqStandbyWizardStep3Controller.create({
+ content: Em.Object.create({})
+ }),
+ cases = [
+ {
+ isLoaded: false,
+ isSubmitDisabled: true,
+ title: 'wizard step content not loaded'
+ },
+ {
+ isLoaded: true,
+ isSubmitDisabled: false,
+ title: 'wizard step content loaded'
+ }
+ ];
+
+ cases.forEach(function (item) {
+ it(item.title, function () {
+ controller.set('isLoaded', item.isLoaded);
+ expect(controller.get('isSubmitDisabled')).to.equal(item.isSubmitDisabled);
+ });
+ });
+
+ });
+
+ describe('#loadConfigTagsSuccessCallback', function () {
+
+ var controller = App.AddHawqStandbyWizardStep3Controller.create({
+ content: Em.Object.create({})
+ });
+
+ it('should send proper ajax request', function () {
+ controller.loadConfigTagsSuccessCallback({
+ 'Clusters': {
+ 'desired_configs': {
+ 'hawq-site': {
+ 'tag': 1
+ }
+ }
+ }
+ }, {}, {
+ 'serviceConfig': {}
+ });
+ var data = testHelpers.findAjaxRequest('name', 'reassign.load_configs')[0].data;
+ expect(data.urlParams).to.equal('(type=hawq-site&tag=1)');
+ expect(data.serviceConfig).to.eql({});
+ });
+
+ });
+
+ describe('#loadConfigsSuccessCallback', function () {
+
+ var controller = App.AddHawqStandbyWizardStep3Controller.create({
+ content: Em.Object.create({})
+ }),
+ cases = [
+ {
+ 'items': [
+ {
+ 'type': 'hawq-site',
+ 'properties': {
+ 'hawq_master_address_host' : 'h0'
+ }
+ }
+ ],
+ 'params': {
+ 'serviceConfig': {}
+ }
+ }
+ ];
+
+ beforeEach(function () {
+ sinon.stub(controller, 'setDynamicConfigValues', Em.K);
+ });
+
+ afterEach(function () {
+ controller.setDynamicConfigValues.restore();
+ });
+
+ cases.forEach(function (item) {
+ it(item.title, function () {
+ controller.loadConfigsSuccessCallback({
+ items: item.items
+ }, {}, item.params);
+ expect(controller.get('selectedService')).to.eql({});
+ expect(controller.get('isLoaded')).to.be.true;
+ });
+ });
+
+ });
+
+ describe('#loadConfigsSuccessCallback=loadConfigsErrorCallback(we have one callback for both cases)', function () {
+
+ var controller = App.AddHawqStandbyWizardStep3Controller.create({
+ content: Em.Object.create({})
+ });
+
+ beforeEach(function () {
+ sinon.stub(controller, 'setDynamicConfigValues', Em.K);
+ });
+
+ afterEach(function () {
+ controller.setDynamicConfigValues.restore();
+ });
+
+ it('should proceed with default value', function () {
+ controller.loadConfigsSuccessCallback({}, {}, {});
+ expect(controller.get('selectedService')).to.eql({});
+ expect(controller.get('isLoaded')).to.be.true;
+ });
+
+ });
+
+
+ describe('#setDynamicConfigValues', function () {
+
+ var data = {
+ items: [
+ {
+ type: 'hawq-site',
+ properties: {
+ hawq_master_address_host : 'h0'
+ }
+ }
+ ]
+ };
+
+ var controller = App.AddHawqStandbyWizardStep3Controller.create({
+ content: Em.Object.create({
+ masterComponentHosts: [
+ {component: 'HAWQMASTER', hostName: 'h0', isInstalled: true},
+ {component: 'HAWQSTANDBY', hostName: 'h1', isInstalled: false}
+ ],
+ slaveComponentHosts: [],
+ hosts: {},
+ hawqHost: {
+ hawqMaster: 'h0',
+ newHawqStandby: 'h1'
+ }
+ })
+ }),
+ configs = {
+ configs: [
+ Em.Object.create({
+ name: 'hawq_standby_address_host'
+ })
+ ]
+ };
+
+
+ beforeEach(function () {
+ controller.setDynamicConfigValues(configs, data);
+ });
+
+ it('hawq_standby_address_host value', function () {
+ expect(configs.configs.findProperty('name', 'hawq_standby_address_host').get('value')).to.equal('h1');
+ });
+ it('hawq_standby_address_host recommendedValue', function () {
+ expect(configs.configs.findProperty('name', 'hawq_standby_address_host').get('recommendedValue')).to.equal('h1');
+ });
+ });
+
+});