You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2014/12/16 20:24:11 UTC

ambari git commit: AMBARI-8707. Failed to move MySQL Server in move Hive Metastore DB. (Sizlard Nemethy via jaimin)

Repository: ambari
Updated Branches:
  refs/heads/trunk 6247e8bde -> e0c421af4


AMBARI-8707. Failed to move MySQL Server in move Hive Metastore DB. (Sizlard Nemethy via jaimin)


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

Branch: refs/heads/trunk
Commit: e0c421af49f60c1fd2c0d1729395c5500917b43a
Parents: 6247e8b
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Tue Dec 16 11:23:49 2014 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Tue Dec 16 11:23:57 2014 -0800

----------------------------------------------------------------------
 .../main/service/reassign/step6_controller.js   | 18 ++++++-------
 ambari-web/app/messages.js                      |  2 +-
 .../service/reassign/step6_controller_test.js   | 28 ++++++++++++++++++++
 3 files changed, 38 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e0c421af/ambari-web/app/controllers/main/service/reassign/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step6_controller.js b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
index f8bc301..bd9efb4 100644
--- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
@@ -22,7 +22,7 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
 
   isReassign: true,
 
-  commands: ['putHostComponentsInMaintenanceMode', 'stopMysqlService', 'deleteHostComponents', 'startServices'],
+  commands: ['stopMysqlService', 'putHostComponentsInMaintenanceMode', 'deleteHostComponents', 'startServices'],
 
   clusterDeployState: 'REASSIGN_MASTER_INSTALLING',
 
@@ -69,7 +69,7 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
 
   removeUnneededTasks: function () {
     if ( this.get('content.reassign.component_name') !== 'MYSQL_SERVER' ) {
-      this.removeTasks(['putHostComponentsInMaintenanceMode', 'stopServices']);
+      this.removeTasks(['putHostComponentsInMaintenanceMode', 'stopMysqlService']);
     }
   },
 
@@ -173,16 +173,16 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
    * make server call to stop services
    */
   stopMysqlService: function () {
-    var data = {
-      "ServiceInfo": {
-        "state": "INSTALLED"
-      }
-    };
+    var data = {};
+
     data.context = "Stop required services";
-    data.urlParams = "ServiceInfo/service_name.in(MYSQL_SERVER)";
+    data.hostName = this.get('content.reassignHosts.source');
+    data.serviceName = 'HIVE';
+    data.HostRoles = { "state": "INSTALLED" };
+    data.componentName = "MYSQL_SERVER";
 
     App.ajax.send({
-      name: 'common.services.update',
+      name: 'common.host.host_component.update',
       sender: this,
       data: data,
       success: 'startPolling',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e0c421af/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 5d6742b..b5da1cb 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1787,7 +1787,7 @@ Em.I18n.translations = {
     '<ol>' +
     '<li>On <b>{1}</b> using a terminal you can export your Metastore DB (MYSQL) using:' +
     '<div class="code-snippet">mysqldump db_name > backup-file.sql</div></li>' +
-    '<li>Copy the file to the target host <b>{2}</b> hosting the MySQL DB<li>' +
+    '<li>Copy the file to the target host <b>{2}</b> hosting the MySQL DB</li>' +
     '<li>Execute this SQL inside <b>mysql<b>' +
     '<div class="code-snippet">CREATE DATABASE db_name;</div></li>' +
     '<li>Import the database using' +

http://git-wip-us.apache.org/repos/asf/ambari/blob/e0c421af/ambari-web/test/controllers/main/service/reassign/step6_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/reassign/step6_controller_test.js b/ambari-web/test/controllers/main/service/reassign/step6_controller_test.js
index b2b3cbe..506a411 100644
--- a/ambari-web/test/controllers/main/service/reassign/step6_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step6_controller_test.js
@@ -204,4 +204,32 @@ describe('App.ReassignMasterWizardStep6Controller', function () {
     });
   });
 
+  describe('#stopMysqlService()', function () {
+    it('stopMysqlService', function () {
+      controller.stopMysqlService();
+      expect(App.ajax.send.calledOnce).to.be.true;
+    });
+  });
+
+  describe('#putHostComponentsInMaintenanceMode()', function () {
+    beforeEach(function(){
+      sinon.stub(controller, 'onComponentsTasksSuccess', Em.K);
+      controller.set('content.reassignHosts.source', 'source');
+    });
+    afterEach(function(){
+      controller.onComponentsTasksSuccess.restore();
+    });
+    it('No host-components', function () {
+      controller.set('hostComponents', []);
+      controller.putHostComponentsInMaintenanceMode();
+      expect(App.ajax.send.called).to.be.false;
+      expect(controller.get('multiTaskCounter')).to.equal(0);
+    });
+    it('One host-components', function () {
+      controller.set('hostComponents', [{}]);
+      controller.putHostComponentsInMaintenanceMode();
+      expect(App.ajax.send.calledOnce).to.be.true;
+      expect(controller.get('multiTaskCounter')).to.equal(0);
+    });
+  });
 });
\ No newline at end of file