incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-3405. NameNode HA Wizard: allow the user to exit out of the wizard with a warning pointing to manual rollback steps. (alexantonenko)
Date Wed, 02 Oct 2013 14:49:27 GMT
Updated Branches:
  refs/heads/branch-1.4.1 4d4270ef7 -> b2649efcc


AMBARI-3405. NameNode HA Wizard: allow the user to exit out of the wizard with a warning pointing
to manual rollback steps. (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/b2649efc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/b2649efc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/b2649efc

Branch: refs/heads/branch-1.4.1
Commit: b2649efccba7b16242d6e69b45648d02ef5e9040
Parents: 4d4270e
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Wed Oct 2 17:46:31 2013 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Wed Oct 2 17:46:31 2013 +0300

----------------------------------------------------------------------
 ambari-web/app/config.js                        |  3 +-
 .../highAvailability/progress_controller.js     | 35 +++++++++++++++++++-
 ambari-web/app/messages.js                      |  1 +
 .../app/routes/high_availability_routes.js      | 22 ++++++++----
 4 files changed, 52 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b2649efc/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 96a4cdd..c21e265 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -59,7 +59,8 @@ App.supports = {
   ldapGroupMapping: false,
   localRepositories: false,
   highAvailability: true,
-  deleteHost: false
+  deleteHost: false,
+  autoRollbackHA: false
 };
 
 if (App.enableExperimental) {

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b2649efc/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
index 4e81da2..3963903 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -119,6 +119,37 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
     task.set('status', 'PENDING');
   },
 
+  manualRollback: function () {
+    App.ModalPopup.show({
+      header: Em.I18n.t('admin.highAvailability.confirmRollbackHeader'),
+      primary: Em.I18n.t('yes'),
+      showCloseButton: false,
+      onPrimary: function () {
+        var controller = App.router.get('highAvailabilityWizardController');
+        controller.clearTasksData();
+        controller.clearStorageData();
+        controller.setCurrentStep('1');
+        App.router.get('updateController').set('isWorking', true);
+        App.clusterStatus.setClusterStatus({
+          clusterName: App.router.get('content.cluster.name'),
+          clusterState: 'HIGH_AVAILABILITY_DISABLED',
+          wizardControllerName: App.router.get('highAvailabilityRollbackController.name'),
+          localdb: App.db.data
+        });
+        this.hide();
+        App.router.transitionTo('main.admin.index');
+        location.reload();
+      },
+      secondary : Em.I18n.t('no'),
+      onSecondary: function(){
+        this.hide();
+      },
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile( Em.I18n.t('admin.highAvailability.confirmManualRollbackBody'))
+      })
+    });
+  },
+
   rollback: function () {
     var task = this.get('tasks').findProperty('status', 'FAILED');
     App.router.get(this.get('content.controllerName')).saveFailedTask(task);
@@ -154,7 +185,9 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
     } else if (this.get('tasks').someProperty('status', 'FAILED')) {
       this.set('status', 'FAILED');
       this.get('tasks').findProperty('status', 'FAILED').set('showRetry', true);
-      this.get('tasks').findProperty('status', 'FAILED').set('showRollback', true);
+      if(App.supports.autoRollbackHA){
+        this.get('tasks').findProperty('status', 'FAILED').set('showRollback', true);
+      }
     }
 
     var statuses = this.get('tasks').mapProperty('status');

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b2649efc/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index cbff539..a1d5eb7 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -657,6 +657,7 @@ Em.I18n.translations = {
   'admin.highAvailability.enabled':'NameNode HA is enabled',
   'admin.highAvailability.confirmRollbackHeader':'Confirm Rollback',
   'admin.highAvailability.confirmRollbackBody':'This will rollback all operations that were
done in HA wizard',
+  'admin.highAvailability.confirmManualRollbackBody':'You are in the process of enabling
NameNode HA. If you exit now, you must follow manual instructions to revert <i>back</i>
to the non-HA setup: <a target=\"_blank\" href=\"/\">link to doc</a>. Are you
sure you want to exit the wizard?',
   'admin.highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster
to enable NameNode HA.',
   'admin.highAvailability.error.namenodeStarted':'NameNode must be running before you enable
NameNode HA.',
   'admin.highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers
in your cluster to enable NameNode HA.',

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b2649efc/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 026894e..a9631fe 100644
--- a/ambari-web/app/routes/high_availability_routes.js
+++ b/ambari-web/app/routes/high_availability_routes.js
@@ -40,7 +40,11 @@ module.exports = Em.Route.extend({
             case "5" :
             case "7" :
             case "9" :
-              this.set('showCloseButton', false);
+              if(App.supports.autoRollbackHA){
+                this.set('showCloseButton', false);
+              }else{
+                this.set('showCloseButton', true);
+              }
               break;
             default :
               this.set('showCloseButton', true);
@@ -50,23 +54,27 @@ module.exports = Em.Route.extend({
         onClose: function () {
           var currStep = App.router.get('highAvailabilityWizardController.currentStep');
           var highAvailabilityProgressPageController = App.router.get('highAvailabilityProgressPageController');
-          if (currStep == "6"){
+          if (currStep == "6" && App.supports.autoRollbackHA){
             highAvailabilityProgressPageController.tasks.push({
               command: "startZooKeeperServers",
               status: "FAILED"
             })
             highAvailabilityProgressPageController.rollback();
-          }else if(currStep == "8"){
+          }else if(currStep == "8" && App.supports.autoRollbackHA){
             highAvailabilityProgressPageController.tasks.push({
               command: "startSecondNameNode",
               status: "FAILED"
             })
             highAvailabilityProgressPageController.rollback();
           }else{
-            this.hide();
-            App.router.get('highAvailabilityWizardController').setCurrentStep('1');
-            App.router.get('updateController').set('isWorking', true);
-            App.router.transitionTo('main.admin.adminHighAvailability');
+            if(parseInt(currStep) > 4 && !App.supports.autoRollbackHA){
+              highAvailabilityProgressPageController.manualRollback();
+            }else {
+              this.hide();
+              App.router.get('highAvailabilityWizardController').setCurrentStep('1');
+              App.router.get('updateController').set('isWorking', true);
+              App.router.transitionTo('main.admin.adminHighAvailability');
+            }
           }
         },
         didInsertElement: function () {


Mime
View raw message