ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-21834. UI changes for Moving Masters. (Ishan via Jaimin)
Date Mon, 11 Sep 2017 18:06:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 dc932a796 -> 6ba7d370c


AMBARI-21834. UI changes for Moving Masters. (Ishan via Jaimin)


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

Branch: refs/heads/branch-2.6
Commit: 6ba7d370cd4b039786b220e6a0f54ec37da27f48
Parents: dc932a7
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Mon Sep 11 11:06:08 2017 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Mon Sep 11 11:06:08 2017 -0700

----------------------------------------------------------------------
 .../rangerAdmin/step4_controller.js             |  2 +-
 .../main/service/reassign/step4_controller.js   |  8 +++++++-
 .../main/service/reassign_controller.js         |  3 ++-
 ambari-web/app/messages.js                      |  4 ++--
 .../wizard/wizardProgressPageController.js      | 21 +++++++++++++-------
 .../views/main/service/reassign/step1_view.js   | 19 +++++++++++++++++-
 .../service/reassign/step4_controller_test.js   | 12 ++++++-----
 7 files changed, 51 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6ba7d370/ambari-web/app/controllers/main/admin/highAvailability/rangerAdmin/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/rangerAdmin/step4_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/rangerAdmin/step4_controller.js
index df96b1f..fe082a4 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/rangerAdmin/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/rangerAdmin/step4_controller.js
@@ -29,7 +29,7 @@ App.RAHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo
   tasksMessagesPrefix: 'admin.ra_highAvailability.wizard.step',
 
   stopAllServices: function () {
-    this.stopServices();
+    this.stopServices([], true, true);
   },
 
   installRangerAdmin: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ba7d370/ambari-web/app/controllers/main/service/reassign/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step4_controller.js b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index 9a40283..c610b13 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -231,7 +231,13 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
    * make server call to stop services
    */
   stopRequiredServices: function () {
-    this.stopServices(this.get('wizardController.relatedServicesMap')[this.get('content.reassign.component_name')],
true);
+    var componentName = this.get('content.reassign.component_name');
+    var servicesToStop = this.get('wizardController.relatedServicesMap')[componentName];
+    if (this.get('content.componentsToStopAllServices').contains(componentName)) {
+      this.stopServices(servicesToStop, true, true);
+    } else {
+      this.stopServices(servicesToStop, true);
+    }
   },
 
   createHostComponents: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ba7d370/ambari-web/app/controllers/main/service/reassign_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js
index 5b3e951..1e11eaf 100644
--- a/ambari-web/app/controllers/main/service/reassign_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign_controller.js
@@ -65,6 +65,7 @@ App.ReassignMasterController = App.WizardController.extend({
     hasCheckDBStep: false,
     componentsWithCheckDBStep: ['HIVE_METASTORE', 'HIVE_SERVER', 'OOZIE_SERVER'],
     componentsWithoutSecurityConfigs: ['MYSQL_SERVER'],
+    componentsToStopAllServices: ['NAMENODE', 'SECONDARY_NAMENODE'],
     reassignComponentsInMM: [],
     configs: null,
     configsAttributes: null
@@ -167,9 +168,9 @@ App.ReassignMasterController = App.WizardController.extend({
    * Used to define list of services to stop/start.
    */
   relatedServicesMap: {
-    'JOBTRACKER': ['PIG', 'OOZIE'],
     'RESOURCEMANAGER': ['YARN', 'MAPREDUCE2', 'TEZ', 'PIG', 'OOZIE', 'SLIDER', 'SPARK'],
     'APP_TIMELINE_SERVER': ['YARN', 'MAPREDUCE2', 'TEZ', 'OOZIE', 'SLIDER', 'SPARK'],
+    'HISTORYSERVER': ['MAPREDUCE2', 'PIG', 'OOZIE'],
     'HIVE_SERVER': ['HIVE', 'FALCON', 'ATLAS', 'OOZIE'],
     'HIVE_METASTORE': ['HIVE', 'PIG', 'FALCON', 'ATLAS', 'OOZIE'],
     'WEBHCAT_SERVER': ['HIVE'],

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ba7d370/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 0edac39..e2421f4 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2289,8 +2289,8 @@ Em.I18n.translations = {
   'services.reassign.step1.message1': 'This wizard will walk you through moving {0}.<br/>',
   'services.reassign.step1.message2': 'The process to reassign {0} involves a combination
of <b>automated steps</b> (that will be handled by the wizard) and ' +
       '<b>manual steps</b> (that you must perform in sequence as instructed by
the wizard).<br/><br/>',
-  'services.reassign.step1.message3': '<br/><b>All required services will be
restarted as part of the wizard. You should plan a cluster maintenance window and prepare
' +
-    'for cluster downtime when moving {0}.</b>',
+  'services.reassign.step1.message3': '<br/><p class="alert">Following services
will be restarted as part of the wizard: <b>{0}</b>. You should plan a cluster
maintenance window and prepare ' +
+    'for cluster downtime when moving {1}.</p>',
 
   'services.reassign.step2.header':'Assign Master',
   'services.reassign.step2.currentHost':'Current:',

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ba7d370/ambari-web/app/mixins/wizard/wizardProgressPageController.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
index 9d9d000..8e43af6 100644
--- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js
+++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
@@ -428,31 +428,38 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent,
{
    * make server call to stop services
    * if stopListedServicesFlag == false; stop all services excluding the services passed
as parameters
    * if stopListedServicesFlag == true; stop only services passed as parameters
-   * if no parameters are passed; stop all services
-   * @param services, stopListedServicesFlag
+   * if namenode or secondary namenode then stop all services
+   * @param services, stopListedServicesFlag, stopAllServices
    * @returns {$.ajax}
    */
-  stopServices: function (services, stopListedServicesFlag) {
+  stopServices: function (services, stopListedServicesFlag, stopAllServices) {
+    var stopAllServices = stopAllServices || false;
     var stopListedServicesFlag = stopListedServicesFlag || false;
     var data = {
       'ServiceInfo': {
         'state': 'INSTALLED'
       }
     };
-    if (services && services.length) {
+    if (stopAllServices) {
+      data.context = "Stop all services";
+    } else {
+      if(!services || !services.length) {
+        services = App.Service.find().mapProperty('serviceName').filter(function (service)
{
+          return service != 'HDFS';
+        });
+      }
       var servicesList;
       if (stopListedServicesFlag) {
         servicesList = services.join(',');
-        } else {
+      } else {
         servicesList =  App.Service.find().mapProperty("serviceName").filter(function (s)
{
           return !services.contains(s)
         }).join(',');
       }
       data.context = "Stop required services";
       data.urlParams = "ServiceInfo/service_name.in(" + servicesList + ")";
-    } else {
-      data.context = "Stop all services";
     }
+
     return App.ajax.send({
       name: 'common.services.update',
       sender: this,

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ba7d370/ambari-web/app/views/main/service/reassign/step1_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign/step1_view.js b/ambari-web/app/views/main/service/reassign/step1_view.js
index ddabf14..b7787c0 100644
--- a/ambari-web/app/views/main/service/reassign/step1_view.js
+++ b/ambari-web/app/views/main/service/reassign/step1_view.js
@@ -18,17 +18,34 @@
 
 
 var App = require('app');
+var stringUtils = require('utils/string_utils');
 
 App.ReassignMasterWizardStep1View = Em.View.extend({
 
   message: function () {
+    var componentName = this.get('controller.content.reassign.component_name');
+    var listOfServices;
+
+    if(this.get('controller.content.componentsToStopAllServices').contains(componentName))
{
+      listOfServices = App.Service.find().mapProperty('serviceName');
+    } else {
+      listOfServices = this.get('controller.target.reassignMasterController.relatedServicesMap')[componentName];
+      if(!listOfServices || !listOfServices.length) {
+        listOfServices = App.Service.find().mapProperty('serviceName').filter(function (service)
{
+          return service != 'HDFS';
+        });
+      }
+    }
+
     var messages = [
       Em.I18n.t('services.reassign.step1.message1').format(this.get('controller.content.reassign.display_name')),
-      Em.I18n.t('services.reassign.step1.message3').format(this.get('controller.content.reassign.display_name'))
+      Em.I18n.t('services.reassign.step1.message3').format(stringUtils.getFormattedStringFromArray(listOfServices),
+        this.get('controller.content.reassign.display_name'))
     ];
     if (this.get('controller.content.hasManualSteps')) {
       messages.splice(1,0, Em.I18n.t('services.reassign.step1.message2').format(this.get('controller.content.reassign.display_name')));
     }
+
     return messages;
   }.property('controller.content.reassign.display_name','controller.content.hasManualSteps'),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ba7d370/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
index 0b00412..5193b7a 100644
--- a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
@@ -260,9 +260,10 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
       controller.stopServices.restore();
     });
     it('stopServices is called with valid list of services', function() {
-      controller.set('content.reassign.component_name', 'JOBTRACKER');
+      controller.set('content.reassign.component_name', 'HISTORYSERVER');
+      controller.set('content.componentsToStopAllServices', ['NAMENODE', 'SECONDARY_NAMENODE'])
       controller.stopRequiredServices();
-      expect(controller.stopServices.calledWith(['PIG', 'OOZIE'], true)).to.be.true;
+      expect(controller.stopServices.calledWith(['MAPREDUCE2', 'PIG', 'OOZIE'], true)).to.be.true;
     });
   });
 
@@ -355,7 +356,8 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
 
   describe('#stopServices()', function () {
     it('request is sent', function () {
-      controller.stopServices();
+      var servicesToStop;
+      controller.stopServices(servicesToStop, true, true);
       var args = testHelpers.findAjaxRequest('name', 'common.services.update');
       expect(args).exists;
     });
@@ -933,9 +935,9 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
       controller.startServices.restore();
     });
     it("component has related services", function() {
-      controller.set('content.reassign.component_name', 'JOBTRACKER');
+      controller.set('content.reassign.component_name', 'HISTORYSERVER');
       controller.startRequiredServices();
-      expect(controller.startServices.calledWith(false, ['PIG', 'OOZIE'], true)).to.be.true;
+      expect(controller.startServices.calledWith(false, ['MAPREDUCE2', 'PIG', 'OOZIE'], true)).to.be.true;
     });
     it("component does not have related services", function() {
       controller.set('content.reassign.component_name', 'C1');


Mime
View raw message