You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2013/10/10 18:23:52 UTC

git commit: AMBARI-3495.NameNode HA wizard: Retry button sticks around after JN install (alexantonenko)

Updated Branches:
  refs/heads/branch-1.4.1 aef29ef22 -> 006fabd7c


AMBARI-3495.NameNode HA wizard: Retry button sticks around after JN install (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/006fabd7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/006fabd7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/006fabd7

Branch: refs/heads/branch-1.4.1
Commit: 006fabd7c001b3ca28caed9d1c0053591ec8afa1
Parents: aef29ef
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Oct 10 19:21:34 2013 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Oct 10 19:23:35 2013 +0300

----------------------------------------------------------------------
 .../highAvailability/progress_controller.js     | 28 +++++++++++++
 .../highAvailability/rollback_controller.js     | 41 +++++++++++++++++++-
 2 files changed, 68 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/006fabd7/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 9bf6462..aaca72d 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -34,6 +34,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   isRollback: false,
 
   loadStep: function () {
+    console.warn('func: loadStep');
     this.clearStep();
     this.loadTasks();
     this.addObserver('tasks.@each.status', this, 'onTaskStatusChange');
@@ -41,6 +42,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   clearStep: function () {
+    console.warn('func: clearStep');
     this.set('isSubmitDisabled', true);
     this.set('tasks', []);
     this.set('logs', []);
@@ -69,6 +71,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   }.property('tasks'),
 
   loadTasks: function () {
+    console.warn('func: loadTasks');
     var self = this;
     var loadedStauses = this.get('content.tasksStatuses');
     var loadedLogs = this.get('content.logs');
@@ -91,14 +94,17 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   setTaskStatus: function (taskId, status) {
+    console.warn('func: setTaskStatus');
     this.get('tasks').findProperty('id', taskId).set('status', status);
   },
 
   restoreTaskLog: function (taskId, log) {
+    console.warn('func: restoreTaskLog');
     this.get('tasks').findProperty('id', taskId).set('hosts', log);
   },
 
   setTaskLogs: function (taskId, tasks) {
+    console.warn('func: setTaskLogs');
     var hosts = [];
     var uniqHosts = tasks.mapProperty('Tasks.host_name').uniq();
     uniqHosts.forEach(function (host) {
@@ -116,6 +122,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   retryTask: function () {
+    console.warn('func: retryTask');
     var task = this.get('tasks').findProperty('status', 'FAILED');
     task.set('showRetry', false);
     task.set('showRollback', false);
@@ -123,6 +130,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   manualRollback: function () {
+    console.warn('func: manualRollback');
     App.ModalPopup.show({
       header: Em.I18n.t('admin.highAvailability.confirmRollbackHeader'),
       primary: Em.I18n.t('yes'),
@@ -154,6 +162,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   rollback: function () {
+    console.warn('func: rollback');
     var task = this.get('tasks').findProperty('status', 'FAILED');
     App.router.get(this.get('content.controllerName')).saveFailedTask(task);
     App.ModalPopup.show({
@@ -174,28 +183,35 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   onTaskStatusChange: function () {
+    console.warn('func: onTaskStatusChange1');
     if (!this.get('tasks').someProperty('status', 'IN_PROGRESS') && !this.get('tasks').someProperty('status', 'QUEUED') && !this.get('tasks').someProperty('status', 'FAILED')) {
       var nextTask = this.get('tasks').findProperty('status', 'PENDING');
       if (nextTask) {
+        console.warn('func: onTaskStatusChange2');
         this.set('status', 'IN_PROGRESS');
         this.setTaskStatus(nextTask.get('id'), 'QUEUED');
         this.set('currentTaskId', nextTask.get('id'));
         this.runTask(nextTask.get('id'));
       } else {
+        console.warn('func: onTaskStatusChange3');
         this.set('status', 'COMPLETED');
         this.set('isSubmitDisabled', false);
       }
     } else if (this.get('tasks').someProperty('status', 'FAILED')) {
+      console.warn('func: onTaskStatusChange4');
       this.set('status', 'FAILED');
       this.get('tasks').findProperty('status', 'FAILED').set('showRetry', true);
       if(App.supports.autoRollbackHA){
         this.get('tasks').findProperty('status', 'FAILED').set('showRollback', true);
       }
     }
+    this.get('tasks').filterProperty('status','COMPLETED').setEach('showRetry', false);
+    this.get('tasks').filterProperty('status','COMPLETED').setEach('showRollback', false);
 
     var statuses = this.get('tasks').mapProperty('status');
     var logs = this.get('tasks').mapProperty('hosts');
     var requestIds = this.get('currentRequestIds');
+    console.warn('func: onTaskStatusChange5',statuses, logs, requestIds);
     App.router.get(this.get('content.controllerName')).saveTasksStatuses(statuses);
     App.router.get(this.get('content.controllerName')).saveRequestIds(requestIds);
     App.router.get(this.get('content.controllerName')).saveLogs(logs);
@@ -211,18 +227,22 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
    run command of appropriate task
    */
   runTask: function (taskId) {
+    console.warn('func: runTask',taskId);
     this[this.get('tasks').findProperty('id', taskId).get('command')]();
   },
 
   onTaskError: function () {
+    console.warn('func: onTaskError');
     this.setTaskStatus(this.get('currentTaskId'), 'FAILED');
   },
 
   onTaskCompleted: function () {
+    console.warn('func: onTaskCompleted');
     this.setTaskStatus(this.get('currentTaskId'), 'COMPLETED');
   },
 
   createComponent: function (componentName, hostName) {
+    console.warn('func: createComponent');
     if (!(hostName instanceof Array)) {
       hostName = [hostName];
     }
@@ -249,6 +269,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   onCreateComponent: function () {
+    console.warn('func: onCreateComponent');
     var hostName = arguments[2].hostName;
     var componentName = arguments[2].componentName;
     var taskNum = arguments[2].taskNum;
@@ -256,6 +277,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   installComponent: function (componentName, hostName, taskNum) {
+    console.warn('func: installComponent');
     if (!(hostName instanceof Array)) {
       hostName = [hostName];
     }
@@ -276,6 +298,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   startComponent: function (componentName, hostName) {
+    console.warn('func: startComponent');
     if (!(hostName instanceof Array)) {
       hostName = [hostName];
     }
@@ -297,17 +320,21 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
 
   startPolling: function (data) {
     if (data) {
+      console.warn('func: startPolling1');
       this.get('currentRequestIds').push(data.Requests.id);
       var tasksCount = arguments[2].taskNum || 1;
       if (tasksCount === this.get('currentRequestIds').length) {
+        console.warn('func: startPolling2');
         this.doPolling();
       }
     } else {
+      console.warn('func: startPolling3');
       this.onTaskCompleted();
     }
   },
 
   doPolling: function () {
+    console.warn('func: doPolling');
     this.setTaskStatus(this.get('currentTaskId'), 'IN_PROGRESS');
     var requestIds = this.get('currentRequestIds');
     for (var i = 0; i < requestIds.length; i++) {
@@ -324,6 +351,7 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
   },
 
   parseLogs: function (logs) {
+    console.warn('func: parseLogs');
     this.get('logs').push(logs.tasks);
     if (this.get('currentRequestIds').length === this.get('logs').length) {
       var tasks = [];

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/006fabd7/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
index c87d6bb..df5e26e 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
@@ -46,6 +46,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   ],
 
   loadStep: function () {
+    console.warn('func: loadStep');
     this.initData();
     this.clearStep();
     this.loadTasks();
@@ -54,12 +55,14 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   initData: function () {
+    console.warn('func: initData');
     this.loadMasterComponentHosts();
     this.loadFailedTask();
     this.loadHdfsClientHosts();
   },
 
   setCommandsAndTasks: function(tmpTasks) {
+    console.warn('func: setCommandsAndTasks');
     var fTask = this.get('failedTask');
     var newCommands = [];
     var newTasks = [];
@@ -97,6 +100,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   clearStep: function () {
+    console.warn('func: clearStep');
     this.set('isSubmitDisabled', true);
     this.set('tasks', []);
     this.set('logs', []);
@@ -123,26 +127,33 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   onTaskStatusChange: function () {
+    console.warn('func: onTaskStatusChange');
     if (!this.get('tasks').someProperty('status', 'IN_PROGRESS') && !this.get('tasks').someProperty('status', 'QUEUED') && !this.get('tasks').someProperty('status', 'FAILED')) {
       var nextTask = this.get('tasks').findProperty('status', 'PENDING');
       if (nextTask) {
+        console.warn('func: onTaskStatusChange1');
         this.set('status', 'IN_PROGRESS');
-        this.runTask(nextTask.get('id'));
         this.setTaskStatus(nextTask.get('id'), 'QUEUED');
         this.set('currentTaskId', nextTask.get('id'));
+        this.runTask(nextTask.get('id'));
       } else {
+        console.warn('func: onTaskStatusChange2');
         this.set('status', 'COMPLETED');
         this.set('isSubmitDisabled', false);
       }
     } else if (this.get('tasks').someProperty('status', 'FAILED')) {
+      console.warn('func: onTaskStatusChange3');
       this.set('status', 'FAILED');
       this.get('tasks').findProperty('status', 'FAILED').set('showRetry', true);
       this.get('tasks').findProperty('status', 'FAILED').set('showSkip', true);
     }
+    this.get('tasks').filterProperty('status','COMPLETED').setEach('showRetry', false);
+    this.get('tasks').filterProperty('status','COMPLETED').setEach('showSkip', false);
 
     var statuses = this.get('tasks').mapProperty('status');
     var logs = this.get('tasks').mapProperty('hosts');
     var requestIds = this.get('currentRequestIds');
+    console.warn('func: onTaskStatusChange4',statuses,logs,requestIds);
     this.saveTasksStatuses(statuses);
     this.saveRequestIds(requestIds);
     this.saveLogs(logs);
@@ -155,6 +166,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   skipTask: function () {
+    console.warn('func: skipTask');
     var task = this.get('tasks').findProperty('status', 'FAILED');
     task.set('showRetry', false);
     task.set('showSkip', false);
@@ -162,6 +174,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   retryTask: function () {
+    console.warn('func: retryTask');
     var task = this.get('tasks').findProperty('status', 'FAILED');
     task.set('showRetry', false);
     task.set('showSkip', false);
@@ -169,6 +182,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   onTaskCompleted: function () {
+    console.warn('func: onTaskCompleted');
     var curTaskStatus = this.getTaskStatus(this.get('currentTaskId'));
     if (curTaskStatus != 'FAILED' && curTaskStatus != 'TIMEDOUT' && curTaskStatus != 'ABORTED') {
       this.setTaskStatus(this.get('currentTaskId'), 'COMPLETED');
@@ -176,10 +190,12 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   getTaskStatus: function (taskId) {
+    console.warn('func: getTaskStatus');
     return this.get('tasks').findProperty('id', taskId).get('status');
   },
 
   loadFailedTask: function(){
+    console.warn('func: loadFailedTask');
     var failedTask = App.db.getHighAvailabilityWizardFailedTask();
     this.set('failedTask', failedTask);
   },
@@ -192,6 +208,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   stopAllServices: function(){
+    console.warn('func: stopAllServices');
     App.ajax.send({
       name: 'admin.high_availability.stop_all_services',
       sender: this,
@@ -200,6 +217,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
     });
   },
   restoreHBaseConfigs: function(){
+    console.warn('func: restoreHBaseConfigs');
     this.loadConfigTag("hbaseSiteTag");
     var hbaseSiteTag = this.get("content.hbaseSiteTag");
     App.ajax.send({
@@ -214,41 +232,51 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   stopFailoverControllers: function(){
+    console.warn('func: stopFailoverControllers');
     var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
     this.stopComponent('ZKFC', hostNames);
   },
   deleteFailoverControllers: function(){
+    console.warn('func: deleteFailoverControllers');
     var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
     this.checkBeforeDelete('ZKFC', hostNames);
   },
   stopStandbyNameNode: function(){
+    console.warn('func: stopStandbyNameNode');
     var hostName = this.get('content.masterComponentHosts').findProperty('isAddNameNode', true).hostName;;
     this.stopComponent('NAMENODE', hostName);
   },
   stopNameNode: function(){
+    console.warn('func: stopNameNode');
     var hostNames = this.get('content.masterComponentHosts').findProperty('isCurNameNode').hostName;
     this.stopComponent('NAMENODE', hostNames);
   },
   restoreHDFSConfigs: function(){
+    console.warn('func: restoreHDFSConfigs');
     this.unInstallHDFSClients();
   },
   enableSecondaryNameNode: function(){
+    console.warn('func: enableSecondaryNameNode');
     var hostName = this.get('content.masterComponentHosts').findProperty('component', 'SECONDARY_NAMENODE').hostName;
     this.installComponent('SECONDARY_NAMENODE', hostName, hostName.length);
   },
   stopJournalNodes: function(){
+    console.warn('func: stopJournalNodes');
     var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
     this.stopComponent('JOURNALNODE', hostNames);
   },
   deleteJournalNodes: function(){
+    console.warn('func: deleteJournalNodes');
     var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
     this.unInstallComponent('JOURNALNODE', hostNames);
   },
   deleteAdditionalNameNode: function(){
+    console.warn('func: deleteAdditionalNameNode');
     var hostNames = this.get('content.masterComponentHosts').filterProperty('isAddNameNode', true).mapProperty('hostName');
     this.unInstallComponent('NAMENODE', hostNames);
   },
   startAllServices: function(){
+    console.warn('func: startAllServices');
     App.ajax.send({
       name: 'admin.high_availability.start_all_services',
       sender: this,
@@ -258,6 +286,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   onLoadHbaseConfigs: function (data) {
+    console.warn('func: onLoadHbaseConfigs');
     var hbaseSiteProperties = data.items.findProperty('type', 'hbase-site').properties;
     App.ajax.send({
       name: 'admin.high_availability.save_configs',
@@ -272,6 +301,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   stopComponent: function (componentName, hostName) {
+    console.warn('func: stopComponent');
     if (!(hostName instanceof Array)) {
       hostName = [hostName];
     }
@@ -292,6 +322,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   onDeletedHDFSClient: function () {
+    console.warn('func: onDeletedHDFSClient');
     var deletedHdfsClients = this.get('deletedHdfsClients');
     var hostName = this.get("content.hdfsClientHostNames");
     var notDeletedHdfsClients = hostName.length - deletedHdfsClients;
@@ -316,6 +347,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   onLoadConfigs: function (data) {
+    console.warn('func: onLoadConfigs');
     this.set('configsSaved', false);
     App.ajax.send({
       name: 'admin.high_availability.save_configs',
@@ -340,6 +372,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   onHdfsConfigsSaved: function () {
+    console.warn('func: onHdfsConfigsSaved');
     if (!this.get('configsSaved')) {
       this.set('configsSaved', true);
       return;
@@ -348,6 +381,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   unInstallHDFSClients: function () {
+    console.warn('func: unInstallHDFSClients');
     var hostName = this.get("content.hdfsClientHostNames");
     for (var i = 0; i < hostName.length; i++) {
       App.ajax.send({
@@ -364,6 +398,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   unInstallComponent: function (componentName, hostName) {
+    console.warn('func: unInstallComponent');
     if (!(hostName instanceof Array)) {
       hostName = [hostName];
     }
@@ -384,6 +419,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   checkBeforeDelete: function (componentName, hostName){
+    console.warn('func: checkBeforeDelete');
     this.set('hostsToPerformDel', []);
     if (!(hostName instanceof Array)) {
       hostName = [hostName];
@@ -405,6 +441,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   checkResult: function () {
+    console.warn('func: checkResult');
     var callback = arguments[2].callback;
     var hostName = arguments[2].hostName;
     var componentName = arguments[2].componentName;
@@ -433,6 +470,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   deleteComponent: function (componentName, hostName) {
+    console.warn('func: deleteComponent');
     if (!(hostName instanceof Array)) {
       hostName = [hostName];
     }
@@ -452,6 +490,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
   },
 
   onDeleteComplete: function () {
+    console.warn('func: onDeleteComplete');
     var leftOp = this.get('numOfDelOperations');
     if(leftOp > 1){
       this.set('numOfDelOperations', leftOp-1);