Updated Branches: refs/heads/trunk 73ba823ae -> 1000552c1
AMBARI-2849. NameNode HA Wizard: progress page after "Initialize Metadata". (Antonenko Alexander via yusaku) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/1000552c Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/1000552c Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/1000552c Branch: refs/heads/trunk Commit: 1000552c10f24623b8aee5e938a290cf07ccaa3d Parents: 73ba823 Author: Yusaku Sako <[email protected]> Authored: Thu Aug 8 18:12:45 2013 -0700 Committer: Yusaku Sako <[email protected]> Committed: Thu Aug 8 18:12:45 2013 -0700 ---------------------------------------------------------------------- ambari-web/app/controllers.js | 1 + .../admin/highAvailability/step9_controller.js | 50 ++++++++++++++++++++ .../admin/highAvailability/wizard_controller.js | 3 +- ambari-web/app/messages.js | 5 ++ .../app/routes/high_availability_routes.js | 22 ++++++++- .../main/admin/highAvailability/step9.hbs | 18 +++++++ .../main/admin/highAvailability/wizard.hbs | 1 + ambari-web/app/utils/ajax.js | 19 +++++++- ambari-web/app/views.js | 1 + .../main/admin/highAvailability/step9_view.js | 25 ++++++++++ .../main/admin/highAvailability/wizard_view.js | 4 ++ 11 files changed, 146 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/controllers.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js index dc2a030..60a3ac6 100644 --- a/ambari-web/app/controllers.js +++ b/ambari-web/app/controllers.js @@ -37,6 +37,7 @@ require('controllers/main/admin/highAvailability/step5_controller'); require('controllers/main/admin/highAvailability/step6_controller'); require('controllers/main/admin/highAvailability/step7_controller'); require('controllers/main/admin/highAvailability/step8_controller'); +require('controllers/main/admin/highAvailability/step9_controller'); require('controllers/main/admin/cluster'); require('controllers/main/admin/stack_upgrade_controller'); require('controllers/main/admin/user'); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js new file mode 100644 index 0000000..1d98775 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js @@ -0,0 +1,50 @@ +/** + * 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.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageController.extend({ + + commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'startAllServices'], + + startSecondNameNode: function () { + var hostName = this.get('content.masterComponentHosts').findProperty('isAddNameNode', true).hostName; + this.startComponent('NAMENODE', hostName); + }, + + installZKFC: function () { + var hostName = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName') + this.createComponent('ZKFC', hostName); + }, + + startZKFC: function () { + var hostName = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName') + this.startComponent('ZKFC', hostName); + }, + + startAllServices: function () { + App.ajax.send({ + name: 'admin.high_availability.start_all_services', + sender: this, + success: 'startPolling', + error: 'onTaskError' + }); + } + +}); + http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js index 39c4f1e..ca2f484 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js @@ -23,7 +23,7 @@ App.HighAvailabilityWizardController = App.WizardController.extend({ name: 'highAvailabilityWizardController', - totalSteps: 8, + totalSteps: 9, /** * Used for hiding back button in wizard @@ -165,6 +165,7 @@ App.HighAvailabilityWizardController = App.WizardController.extend({ loadAllPriorSteps: function () { var step = this.get('currentStep'); switch (step) { + case '9': case '8': case '7': case '6': http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 602c20b..fc93bfd 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -664,6 +664,11 @@ Em.I18n.translations = { 'admin.highAvailability.wizard.step7.task0.title':'Start ZooKeeper Servers', 'admin.highAvailability.wizard.step7.task1.title':'Start NameNode', + 'admin.highAvailability.wizard.step9.task0.title':'Start Additional NameNode', + 'admin.highAvailability.wizard.step9.task1.title':'Install Failover Controllers', + 'admin.highAvailability.wizard.step9.task2.title':'Start Failover Controllers', + 'admin.highAvailability.wizard.step9.task3.title':'Start All Services', + 'admin.highAvailability.wizard.step3.nn1':'Current NameNode is on {0}.', 'admin.highAvailability.wizard.step3.nn2':'Additional NameNode will be installed on {0}.', 'admin.highAvailability.wizard.step3.sn':'Existing Secondary NameNode on {0} will be disabled.', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/routes/high_availability_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/high_availability_routes.js b/ambari-web/app/routes/high_availability_routes.js index da06316..ac086b3 100644 --- a/ambari-web/app/routes/high_availability_routes.js +++ b/ambari-web/app/routes/high_availability_routes.js @@ -194,6 +194,24 @@ module.exports = Em.Route.extend({ } }), + step9: Em.Route.extend({ + route: '/step9', + connectOutlets: function (router) { + var controller = router.get('highAvailabilityWizardController'); + controller.setCurrentStep('9'); + controller.setLowerStepsDisable(9); + controller.dataLoading().done(function () { + controller.loadAllPriorSteps(); + controller.connectOutlet('highAvailabilityWizardStep9', controller.get('content')); + }) + }, + back: function (router) { + router.transitionTo('step8'); + }, + next: function (router) { + } + }), + gotoStep1: Em.Router.transitionTo('step1'), gotoStep2: Em.Router.transitionTo('step2'), @@ -208,5 +226,7 @@ module.exports = Em.Route.extend({ gotoStep7: Em.Router.transitionTo('step7'), - gotoStep8: Em.Router.transitionTo('step8') + gotoStep8: Em.Router.transitionTo('step8'), + + gotoStep9: Em.Router.transitionTo('step9') }); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/templates/main/admin/highAvailability/step9.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability/step9.hbs b/ambari-web/app/templates/main/admin/highAvailability/step9.hbs new file mode 100644 index 0000000..defea53 --- /dev/null +++ b/ambari-web/app/templates/main/admin/highAvailability/step9.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/main/admin/highAvailability/progress"}} http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs b/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs index 4ad0154..09bb2ee 100644 --- a/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs +++ b/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs @@ -33,6 +33,7 @@ <li {{bindAttr class="isStep6:active view.isStep6Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep6 target="controller"}}>{{t admin.highAvailability.wizard.step6.header}}</a></li> <li {{bindAttr class="isStep7:active view.isStep7Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep7 target="controller"}}>{{t admin.highAvailability.wizard.progressPage.header}}</a></li> <li {{bindAttr class="isStep8:active view.isStep8Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep8 target="controller"}}>{{t admin.highAvailability.wizard.step8.header}}</a></li> + <li {{bindAttr class="isStep9:active view.isStep9Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep9 target="controller"}}>{{t admin.highAvailability.wizard.progressPage.header}}</a></li> </ul> </div> </div> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/utils/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js index 6c45490..3e6d42c 100644 --- a/ambari-web/app/utils/ajax.js +++ b/ambari-web/app/utils/ajax.js @@ -565,7 +565,6 @@ var urls = { }, 'admin.high_availability.stop_all_services': { 'real': '/clusters/{clusterName}/services?ServiceInfo/state=STARTED', - 'mock': 'fsdfs', 'format': function (data, opt) { return { type: 'PUT', @@ -582,6 +581,24 @@ var urls = { } } }, + 'admin.high_availability.start_all_services': { + 'real': '/clusters/{clusterName}/services?ServiceInfo/state=INSTALLED', + 'format': function (data, opt) { + return { + type: 'PUT', + data: JSON.stringify({ + "RequestInfo": { + "context": "Start all services" + }, + "Body": { + "ServiceInfo": { + "state": "STARTED" + } + } + }) + } + } + }, 'admin.high_availability.polling': { 'real': '/clusters/{clusterName}/requests/{requestId}?fields=tasks/*', 'mock': '', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/views.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js index 02b84a2..30a9076 100644 --- a/ambari-web/app/views.js +++ b/ambari-web/app/views.js @@ -64,6 +64,7 @@ require('views/main/admin/highAvailability/step5_view'); require('views/main/admin/highAvailability/step6_view'); require('views/main/admin/highAvailability/step7_view'); require('views/main/admin/highAvailability/step8_view'); +require('views/main/admin/highAvailability/step9_view'); require('views/main/admin/cluster'); require('views/main/admin/misc_view'); require('views/main/admin/stack_upgrade'); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/views/main/admin/highAvailability/step9_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/step9_view.js b/ambari-web/app/views/main/admin/highAvailability/step9_view.js new file mode 100644 index 0000000..40780bc --- /dev/null +++ b/ambari-web/app/views/main/admin/highAvailability/step9_view.js @@ -0,0 +1,25 @@ +/** + * 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.HighAvailabilityWizardStep9View = App.HighAvailabilityProgressPageView.extend({ + + templateName: require('templates/main/admin/highAvailability/step9') +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1000552c/ambari-web/app/views/main/admin/highAvailability/wizard_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/wizard_view.js b/ambari-web/app/views/main/admin/highAvailability/wizard_view.js index 84a776f..0852de1 100644 --- a/ambari-web/app/views/main/admin/highAvailability/wizard_view.js +++ b/ambari-web/app/views/main/admin/highAvailability/wizard_view.js @@ -55,6 +55,10 @@ App.HighAvailabilityWizardView = Em.View.extend({ return this.isStepDisabled(8); }.property('[email protected]').cacheable(), + isStep9Disabled: function () { + return this.isStepDisabled(9); + }.property('[email protected]').cacheable(), + isStepDisabled: function (index) { return this.get('controller.isStepDisabled').findProperty('step', index).get('value'); }
