You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/08/23 20:10:06 UTC
git commit: AMBARI-3011. NameNode HA Wizard: Changes to the final
step. (akovalenko via yusaku)
Updated Branches:
refs/heads/trunk de61875d1 -> 74eab8d6f
AMBARI-3011. NameNode HA Wizard: Changes to the final step. (akovalenko 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/74eab8d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/74eab8d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/74eab8d6
Branch: refs/heads/trunk
Commit: 74eab8d6f2a4a0e3500117b480f15f5fabcc6439
Parents: de61875
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Fri Aug 23 11:09:37 2013 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Fri Aug 23 11:09:37 2013 -0700
----------------------------------------------------------------------
.../admin/highAvailability/step9_controller.js | 19 ++++++++++---
ambari-web/app/messages.js | 2 ++
ambari-web/app/router.js | 2 +-
.../app/routes/high_availability_routes.js | 28 +++++++++-----------
.../main/admin/highAvailability/progress.hbs | 2 +-
ambari-web/app/utils/ajax.js | 5 ++++
.../admin/highAvailability/progress_view.js | 14 +++++++---
.../main/admin/highAvailability/step9_view.js | 6 ++++-
8 files changed, 53 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/74eab8d6/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
index 7eafcc4..173dfa2 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js
@@ -22,7 +22,7 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
name:"highAvailabilityWizardStep9Controller",
- commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'startAllServices'],
+ commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'startAllServices', 'deleteSNameNode'],
startSecondNameNode: function () {
var hostName = this.get('content.masterComponentHosts').findProperty('isAddNameNode', true).hostName;
@@ -39,12 +39,12 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
},
onZKFCCreate: function () {
- var hostName = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName')
+ 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')
+ var hostName = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
this.startComponent('ZKFC', hostName);
},
@@ -55,6 +55,19 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
success: 'startPolling',
error: 'onTaskError'
});
+ },
+
+ deleteSNameNode: function () {
+ var hostName = this.get('content.masterComponentHosts').findProperty('component', 'SECONDARY_NAMENODE').hostName;
+ App.ajax.send({
+ name: 'admin.high_availability.delete_snamenode',
+ sender: this,
+ data: {
+ hostName: hostName
+ },
+ success: 'onTaskCompleted',
+ error: 'onTaskError'
+ });
}
});
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/74eab8d6/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index cda511c..5b6bfbf 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -676,6 +676,8 @@ Em.I18n.translations = {
'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.step9.task4.title':'Delete Secondary NameNode',
+ 'admin.highAvailability.wizard.step9.notice.completed':'"NameNode HA has been enabled successfully.',
'admin.highAvailability.wizard.step3.nn1':'Current NameNode is on {0}.',
'admin.highAvailability.wizard.step3.nn2':'Additional NameNode will be installed on {0}.',
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/74eab8d6/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index 2cecd3f..a86ff74 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -271,7 +271,7 @@ App.Router = Em.Router.extend({
var clusterStatusOnServer = App.clusterStatus.get('value');
if (!localStorage.getObject('ambari').app.user.admin || clusterStatusOnServer && (clusterStatusOnServer.clusterState === 'CLUSTER_STARTED_5' ||
clusterStatusOnServer.clusterState === 'ADD_HOSTS_COMPLETED_5' || clusterStatusOnServer.clusterState === 'STACK_UPGRADE_COMPLETED' ||
- clusterStatusOnServer.clusterState === 'REASSIGN_MASTER_COMPLETED') ||clusterStatusOnServer.clusterState === 'SECURITY_COMPLETED' ) {
+ clusterStatusOnServer.clusterState === 'REASSIGN_MASTER_COMPLETED' || clusterStatusOnServer.clusterState === 'SECURITY_COMPLETED' || clusterStatusOnServer.clusterState === 'HIGH_AVAILABILITY_COMPLETED')) {
return 'main.index';
} else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('addHostController.name')) {
// if wizardControllerName == "addHostController", then it means someone closed the browser or the browser was crashed when we were last in Add Hosts wizard
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/74eab8d6/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 53710d2..aaf3e54 100644
--- a/ambari-web/app/routes/high_availability_routes.js
+++ b/ambari-web/app/routes/high_availability_routes.js
@@ -23,7 +23,7 @@ module.exports = Em.Route.extend({
Em.run.next(function () {
var highAvailabilityWizardController = router.get('highAvailabilityWizardController');
App.router.get('updateController').set('isWorking', false);
- App.ModalPopup.show({
+ var popup = App.ModalPopup.show({
classNames: ['full-width-modal'],
header: Em.I18n.t('admin.highAvailability.wizard.header'),
bodyClass: App.HighAvailabilityWizardView.extend({
@@ -45,6 +45,7 @@ module.exports = Em.Route.extend({
this.fitHeight();
}
});
+ highAvailabilityWizardController.set('popup', popup);
App.clusterStatus.updateFromServer();
var currentClusterStatus = App.clusterStatus.get('value');
if (currentClusterStatus) {
@@ -160,9 +161,6 @@ module.exports = Em.Route.extend({
unroutePath: function () {
return false;
},
- back: function (router) {
- router.transitionTo('step4');
- },
next: function (router) {
router.transitionTo('step6');
}
@@ -182,9 +180,6 @@ module.exports = Em.Route.extend({
unroutePath: function () {
return false;
},
- back: function (router) {
- router.transitionTo('step5');
- },
next: function (router) {
router.transitionTo('step7');
}
@@ -204,9 +199,6 @@ module.exports = Em.Route.extend({
unroutePath: function () {
return false;
},
- back: function (router) {
- router.transitionTo('step6');
- },
next: function (router) {
router.transitionTo('step8');
}
@@ -226,9 +218,6 @@ module.exports = Em.Route.extend({
unroutePath: function () {
return false;
},
- back: function (router) {
- router.transitionTo('step7');
- },
next: function (router) {
router.transitionTo('step9');
}
@@ -248,10 +237,17 @@ module.exports = Em.Route.extend({
unroutePath: function () {
return false;
},
- back: function (router) {
- router.transitionTo('step8');
- },
next: function (router) {
+ var controller = router.get('highAvailabilityWizardController');
+ controller.finish();
+ controller.get('popup').hide();
+ App.clusterStatus.setClusterStatus({
+ clusterName: controller.get('content.cluster.name'),
+ clusterState: 'HIGH_AVAILABILITY_COMPLETED',
+ wizardControllerName: 'highAvailabilityWizardController',
+ localdb: App.db.data
+ });
+ router.transitionTo('main.index');
}
}),
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/74eab8d6/ambari-web/app/templates/main/admin/highAvailability/progress.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/progress.hbs b/ambari-web/app/templates/main/admin/highAvailability/progress.hbs
index c20cb63..ee410b1 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/progress.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/progress.hbs
@@ -46,6 +46,6 @@
{{/view}}
{{/each}}
<div class="btn-area">
- <a {{bindAttr class=":btn controller.isSubmitDisabled:disabled :btn-success :pull-right"}} {{action done target="controller"}}>{{t common.next}}</a>
+ <a {{bindAttr class=":btn controller.isSubmitDisabled:disabled :btn-success :pull-right"}} {{action done target="controller"}}>{{view.submitButtonText}}</a>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/74eab8d6/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index 48d7e47..6a64feb 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/ambari-web/app/utils/ajax.js
@@ -736,6 +736,11 @@ var urls = {
}
}
},
+ 'admin.high_availability.delete_snamenode': {
+ 'real': '/clusters/{clusterName}/hosts/{hostName}/host_components/SECONDARY_NAMENODE',
+ 'mock': '',
+ 'type': 'DELETE'
+ },
'admin.security.cluster_configs': {
'real': '/clusters/{clusterName}',
'format': function (data, opt) {
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/74eab8d6/ambari-web/app/views/main/admin/highAvailability/progress_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/progress_view.js b/ambari-web/app/views/main/admin/highAvailability/progress_view.js
index 56aa76b..ad5c985 100644
--- a/ambari-web/app/views/main/admin/highAvailability/progress_view.js
+++ b/ambari-web/app/views/main/admin/highAvailability/progress_view.js
@@ -25,6 +25,14 @@ App.HighAvailabilityProgressPageView = Em.View.extend({
this.get('controller').loadStep();
},
+ submitButtonText: Em.I18n.t('common.next'),
+
+ noticeCompleted: Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.completed'),
+
+ noticeFailed: Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.failed'),
+
+ noticeInProgress: Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.inProgress'),
+
notice: Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.inProgress'),
noticeClass: 'alert alert-info',
@@ -32,13 +40,13 @@ App.HighAvailabilityProgressPageView = Em.View.extend({
onStatusChange: function () {
var status = this.get('controller.status');
if (status === 'COMPLETED') {
- this.set('notice', Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.completed'));
+ this.set('notice', this.get('noticeCompleted'));
this.set('noticeClass', 'alert alert-success');
} else if (status === 'FAILED') {
- this.set('notice', Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.failed'));
+ this.set('notice', this.get('noticeFailed'));
this.set('noticeClass', 'alert alert-error');
} else {
- this.set('notice', Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.inProgress'));
+ this.set('notice', this.get('noticeInProgress'));
this.set('noticeClass', 'alert alert-info');
}
}.observes('controller.status'),
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/74eab8d6/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
index 40780bc..fc86105 100644
--- a/ambari-web/app/views/main/admin/highAvailability/step9_view.js
+++ b/ambari-web/app/views/main/admin/highAvailability/step9_view.js
@@ -21,5 +21,9 @@ var App = require('app');
App.HighAvailabilityWizardStep9View = App.HighAvailabilityProgressPageView.extend({
- templateName: require('templates/main/admin/highAvailability/step9')
+ templateName: require('templates/main/admin/highAvailability/step9'),
+
+ submitButtonText: Em.I18n.t('common.done'),
+
+ noticeCompleted: Em.I18n.t('admin.highAvailability.wizard.step9.notice.completed')
});