You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2016/05/09 20:18:59 UTC

ambari git commit: AMBARI-16236. HAWQ service can be stopped and checked even when STANDBY MASTER is stopped (adenissov)

Repository: ambari
Updated Branches:
  refs/heads/trunk 177d7a3ba -> b26ef1e67


AMBARI-16236. HAWQ service can be stopped and checked even when STANDBY MASTER is stopped (adenissov)


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

Branch: refs/heads/trunk
Commit: b26ef1e6761b5408cca992378b44ce33616ea559
Parents: 177d7a3
Author: Alexander Denissov <ad...@pivotal.io>
Authored: Mon May 9 13:18:35 2016 -0700
Committer: Alexander Denissov <ad...@pivotal.io>
Committed: Mon May 9 13:18:35 2016 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/item.js |  3 +
 .../test/controllers/main/service/item_test.js  | 62 ++++++++++++++++++++
 2 files changed, 65 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b26ef1e6/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index bfede8a..9250bfc 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -1002,6 +1002,9 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
     if (App.get('isHaEnabled') && this.get('content.serviceName') == 'HDFS' && this.get('content.hostComponents').filterProperty('componentName', 'NAMENODE').someProperty('workStatus', App.HostComponentStatus.started)) {
       return false;
     }
+    if (this.get('content.serviceName') == 'HAWQ' && this.get('content.hostComponents').filterProperty('componentName', 'HAWQMASTER').someProperty('workStatus', App.HostComponentStatus.started)) {
+      return false;
+    }
     return (this.get('content.healthStatus') != 'green');
   }.property('content.healthStatus','isPending', 'App.isHaEnabled'),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26ef1e6/ambari-web/test/controllers/main/service/item_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/item_test.js b/ambari-web/test/controllers/main/service/item_test.js
index 4bac784..383aa2f 100644
--- a/ambari-web/test/controllers/main/service/item_test.js
+++ b/ambari-web/test/controllers/main/service/item_test.js
@@ -945,6 +945,68 @@ describe('App.MainServiceItemController', function () {
     });
   });
 
+  describe("#isHAWQStopDisabled", function () {
+    var tests = [
+      {
+        content: {
+          serviceName: 'HAWQ',
+          healthStatus: 'green',
+          hostComponents: [
+            {
+              componentName: 'HAWQMASTER',
+              workStatus: 'STARTED'
+            }, {
+              componentName: 'HAWQSTANDBY',
+              workStatus: 'STARTED'
+            }]
+        },
+        isPending: true,
+        disabled: true,
+        m: "disabled because of pending"
+      },
+      {
+        content: {
+          serviceName: 'HAWQ',
+          healthStatus: 'red',
+          hostComponents: [
+            {
+              componentName: 'HAWQMASTER',
+              workStatus: 'INSTALLED'
+            }, {
+              componentName: 'HAWQSTANDBY',
+              workStatus: 'STARTED'
+            }]
+        },
+        isPending: false,
+        disabled: true,
+        m: "disabled because HAWQMASTER is stopped and health is red"
+      },
+      {
+        content: {
+          serviceName: 'HAWQ',
+          healthStatus: 'green',
+          hostComponents: [
+            {
+              componentName: 'HAWQMASTER',
+              workStatus: 'STARTED'
+            }, {
+              componentName: 'HAWQSTANDBY',
+              workStatus: 'INSTALLED'
+            }]
+        },
+        isPending: false,
+        disabled: false,
+        m: "enabled because HAWQMASTER is started"
+      }
+    ];
+    tests.forEach(function (test) {
+      it(test.m, function () {
+        var mainServiceItemController = App.MainServiceItemController.create({content: test.content, isPending: test.isPending});
+        expect(mainServiceItemController.get('isStopDisabled')).to.equal(test.disabled);
+      });
+    });
+  });
+
   describe("#runRebalancer", function () {
 
     beforeEach(function () {