ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject git commit: AMBARI-4967: Security wizard: Start all services call should wait for the result of Delete ATS component call. (jaimin)
Date Thu, 06 Mar 2014 03:38:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 7adcb0db1 -> 6799d16f6


AMBARI-4967: Security wizard: Start all services call should wait for the result of Delete
ATS component call. (jaimin)


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

Branch: refs/heads/trunk
Commit: 6799d16f68e430d9dcf4df128417a812d06f837b
Parents: 7adcb0d
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Wed Mar 5 19:38:13 2014 -0800
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Wed Mar 5 19:38:28 2014 -0800

----------------------------------------------------------------------
 .../main/admin/security/add/step4.js            | 35 ++++++++++++++++
 .../security/security_progress_controller.js    | 43 +++++++-------------
 ambari-web/app/messages.js                      |  1 +
 .../app/templates/main/service/reconfigure.hbs  | 41 ++++++++++---------
 ambari-web/app/utils/polling.js                 |  1 +
 5 files changed, 73 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6799d16f/ambari-web/app/controllers/main/admin/security/add/step4.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/security/add/step4.js b/ambari-web/app/controllers/main/admin/security/add/step4.js
index 6009abf..7c53725 100644
--- a/ambari-web/app/controllers/main/admin/security/add/step4.js
+++ b/ambari-web/app/controllers/main/admin/security/add/step4.js
@@ -22,6 +22,7 @@ App.MainAdminSecurityAddStep4Controller = App.MainAdminSecurityProgressControlle
   name: 'mainAdminSecurityAddStep4Controller',
 
   serviceUsersBinding: 'App.router.mainAdminSecurityController.serviceUsers',
+  totalSteps: 4,
 
   secureServices: function() {
     return  this.get('content.services');
@@ -63,6 +64,15 @@ App.MainAdminSecurityAddStep4Controller = App.MainAdminSecurityProgressControlle
     this.get('serviceConfigTags').clear();
   },
 
+  loadStages: function () {
+    this.get('stages').pushObjects([
+      App.Poll.create({stage: 'stage2', label: Em.I18n.translations['admin.addSecurity.apply.stage2'],
isPolling: true, name: 'STOP_SERVICES', isVisible: true}),
+      App.Poll.create({stage: 'stage3', label: Em.I18n.translations['admin.addSecurity.apply.stage3'],
isPolling: false, name: 'APPLY_CONFIGURATIONS', isVisible: true}),
+      App.Poll.create({stage: 'stage5', label: Em.I18n.translations['admin.addSecurity.apply.delete.ats'],
isPolling: false, name: 'DELETE_ATS', isVisible: false}),
+      App.Poll.create({stage: 'stage4', label: Em.I18n.translations['admin.addSecurity.apply.stage4'],
isPolling: true, name: 'START_SERVICES', isVisible: true})
+    ]);
+  },
+
   loadStep: function () {
     this.set('secureMapping', require('data/secure_mapping').slice(0));
     this.clearStep();
@@ -371,6 +381,31 @@ App.MainAdminSecurityAddStep4Controller = App.MainAdminSecurityProgressControlle
     return true;
   },
 
+  deleteComponents: function(componentName, hostName) {
+    App.ajax.send({
+      name: 'admin.delete_component',
+      sender: this,
+      data: {
+        componentName: componentName,
+        hostName: hostName
+      },
+      success: 'onDeleteComplete',
+      error: 'onDeleteError'
+    });
+  },
+
+  onDeleteComplete: function () {
+    var deleteAtsStage = this.get('stages').findProperty('name', 'DELETE_ATS');
+    console.warn('APP_TIMELINE_SERVER doesn\'t support security mode. It has been removed
from YARN service ');
+    deleteAtsStage.set('isError', false);
+    deleteAtsStage.set('isSuccess', true);
+  },
+
+  onDeleteError: function () {
+    console.warn('Error: Can\'t delete APP_TIMELINE_SERVER');
+  },
+
+
   onJsError: function () {
     App.ModalPopup.show({
       header: Em.I18n.t('common.error'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/6799d16f/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
b/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
index 2b02e02..8a8b5cd 100644
--- a/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/security/security_progress_controller.js
@@ -39,7 +39,6 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
   serviceConfigTags: [],
   globalProperties: [],
   totalSteps: 3,
-
   isSubmitDisabled: true,
 
 
@@ -95,15 +94,9 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
         currentStage = startedStages.findProperty('isCompleted', false);
       }
       if (currentStage && currentStage.get('isPolling') === true) {
-        if (currentStage.get('name') === 'START_SERVICES' && !App.router.get('addSecurityController.securityEnabled'))
{
-          var timeLineServer = App.Service.find('YARN').get('hostComponents').findProperty('componentName',
'APP_TIMELINE_SERVER');
-          if (timeLineServer) {
-            this.deleteComponents('APP_TIMELINE_SERVER', timeLineServer.get('host.hostName'));
-          }
-        }
         currentStage.set('isStarted', true);
         currentStage.start();
-      } else if (currentStage && currentStage.get('stage') === 'stage3') {
+      } else if (currentStage && currentStage.get('name') === 'APPLY_CONFIGURATIONS')
{
         currentStage.set('isStarted', true);
         if (App.testMode) {
           currentStage.set('isError', false);
@@ -111,10 +104,22 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
         } else {
           this.loadClusterConfigs();
         }
+      } else if (currentStage && currentStage.get('name') === 'DELETE_ATS') {
+        currentStage.set('isStarted', true);
+        if (App.testMode) {
+          currentStage.set('isError', false);
+          currentStage.set('isSuccess', true);
+        } else {
+          var timeLineServer = App.Service.find('YARN').get('hostComponents').findProperty('componentName',
'APP_TIMELINE_SERVER');
+          if (timeLineServer && !App.router.get('mainAdminSecurityController.securityEnabled'))
{
+            this.deleteComponents('APP_TIMELINE_SERVER', timeLineServer.get('host.hostName'));
+          }
+        }
       }
     }
   },
 
+
   onCompleteStage: function () {
     if (this.get('stages').length === this.totalSteps) {
       var index = this.get('stages').filterProperty('isSuccess', true).length;
@@ -168,27 +173,6 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
     });
   },
 
-  deleteComponents: function(componentName, hostName) {
-    App.ajax.send({
-      name: 'admin.delete_component',
-      sender: this,
-      data: {
-        componentName: componentName,
-        hostName: hostName
-      },
-      success: 'onDeleteComplete',
-      error: 'onDeleteError'
-    });
-  },
-
-  onDeleteComplete: function () {
-    console.warn('APP_TIMELINE_SERVER doesn\'t support security mode. It has been removed
from YARN service ');
-  },
-
-  onDeleteError: function () {
-    console.warn('Error: Can\'t delete APP_TIMELINE_SERVER');
-  },
-
   loadClusterConfigsSuccessCallback: function (data) {
     var self = this;
     //prepare tags to fetch all configuration for a service
@@ -347,6 +331,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
           stage: _stage.get('stage'),
           label: _stage.get('label'),
           isPolling: _stage.get('isPolling'),
+          isVisible:  _stage.get('isVisible'),
           isStarted: _stage.get('isStarted'),
           requestId: _stage.get('requestId'),
           isSuccess: _stage.get('isSuccess'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/6799d16f/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index a1b5c05..8cee572 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -937,6 +937,7 @@ Em.I18n.translations = {
   'admin.addSecurity.apply.stage3': '2. Save Configurations',
   'admin.addSecurity.apply.stage4': '3. Start Services',
   'admin.addSecurity.apply.stage5': '5. Smoke Test',
+  'admin.addSecurity.apply.delete.ats': 'Delete ATS',
   'admin.addSecurity.user.smokeUser': 'Ambari Smoke Test User',
   'admin.addSecurity.user.hdfsUser': 'HDFS User',
   'admin.addSecurity.user.hbaseUser': 'HBase User',

http://git-wip-us.apache.org/repos/asf/ambari/blob/6799d16f/ambari-web/app/templates/main/service/reconfigure.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/reconfigure.hbs b/ambari-web/app/templates/main/service/reconfigure.hbs
index 3e6c62c..f660c7c 100644
--- a/ambari-web/app/templates/main/service/reconfigure.hbs
+++ b/ambari-web/app/templates/main/service/reconfigure.hbs
@@ -18,14 +18,15 @@
 
 <table id="security-stages" class="table no-borders">
   <tbody>
-    {{#each stage in controller.stages}}
-    <tr>
-      <td>
-      {{#view App.StageLabelView stageBinding="stage"}}
-          <p {{bindAttr class="view.isStarted::faintText"}}>{{stage.label}}</p>
-      {{/view}}
-      </td>
-      <td>
+  {{#each stage in controller.stages}}
+    {{#if stage.isVisible}}
+      <tr>
+        <td>
+          {{#view App.StageLabelView stageBinding="stage"}}
+            <p {{bindAttr class="view.isStarted::faintText"}}>{{stage.label}}</p>
+          {{/view}}
+        </td>
+        <td>
           {{#if stage.isCompleted}}
             {{#if stage.isSuccess}}
               {{view App.StageSuccessView}}
@@ -44,16 +45,18 @@
               {{/if}}
             {{/if}}
           {{/if}}
-      </td>
-      <td>
-        {{#if stage.isError}}
-          <a class="btn btn-primary"
-             href="javascript:void(null)" {{action retry target = "controller"}}><i
class="icon-repeat icon-white"></i>
-            {{t common.retry}}
-          </a>
-        {{/if}}
-      </td>
-    </tr>
-    {{/each}}
+        </td>
+        <td>
+          {{#if stage.isError}}
+            <a class="btn btn-primary"
+               href="javascript:void(null)" {{action retry target = "controller"}}><i
+                    class="icon-repeat icon-white"></i>
+              {{t common.retry}}
+            </a>
+          {{/if}}
+        </td>
+      </tr>
+    {{/if}}
+  {{/each}}
   </tbody>
 </table>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6799d16f/ambari-web/app/utils/polling.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/polling.js b/ambari-web/app/utils/polling.js
index a239391..97d7348 100644
--- a/ambari-web/app/utils/polling.js
+++ b/ambari-web/app/utils/polling.js
@@ -21,6 +21,7 @@ App.Poll = Em.Object.extend({
   name: '',
   stage: '',
   label: '',
+  isVisible: true,
   isStarted: false,
   isPolling: true,
   clusterName: null,


Mime
View raw message