Repository: ambari
Updated Branches:
  refs/heads/trunk 666aec8aa -> 17da93d58


AMBARI-9104. Restart slaves item is missed in Service Actions combobox. 
(akovalenko)


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

Branch: refs/heads/trunk
Commit: 17da93d58b25b687119c2ce7a9c1a886910790c7
Parents: 666aec8
Author: Aleksandr Kovalenko <[email protected]>
Authored: Tue Jan 13 17:08:12 2015 +0200
Committer: Aleksandr Kovalenko <[email protected]>
Committed: Tue Jan 13 17:08:12 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/views/main/service/item.js       |  2 +-
 ambari-web/test/views/main/service/item_test.js | 46 ++++++++++++--------
 2 files changed, 29 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/17da93d5/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js 
b/ambari-web/app/views/main/service/item.js
index 857f1a1..21ee93b 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -197,7 +197,7 @@ App.MainServiceItemView = Em.View.extend({
     var options = [];
     var service = this.get('controller.content');
     var allMasters = 
service.get('hostComponents').filterProperty('isMaster').mapProperty('componentName').uniq();
-    var allSlaves = 
service.get('hostComponents').filterProperty('isSlave').mapProperty('componentName').uniq();
+    var allSlaves = 
service.get('slaveComponents').rejectProperty('totalCount', 
0).mapProperty('componentName');
     var actionMap = this.actionMap();
     var serviceCheckSupported = 
App.get('services.supportsServiceCheck').contains(service.get('serviceName'));
     var hasConfigTab = this.get('hasConfigTab');

http://git-wip-us.apache.org/repos/asf/ambari/blob/17da93d5/ambari-web/test/views/main/service/item_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/item_test.js 
b/ambari-web/test/views/main/service/item_test.js
index bb08228..6ca3e37 100644
--- a/ambari-web/test/views/main/service/item_test.js
+++ b/ambari-web/test/views/main/service/item_test.js
@@ -79,12 +79,13 @@ describe('App.MainServiceItemView', function () {
           displayName: "HDFS",
           isSingleNode: true,
           serviceTypes: ["HA_MODE"],
-          hostComponents: [
+          slaveComponents: [
             Em.Object.create({
               componentName: 'DATANODE',
-              isMaster: false,
-              isSlave: true
-            }),
+              totalCount: 1
+            })
+          ],
+          hostComponents: [
             Em.Object.create({
               componentName: 'HDFS_CLIENT',
               isMaster: false,
@@ -106,7 +107,7 @@ describe('App.MainServiceItemView', function () {
             {"action": "rollingRestart", "label": "Restart DataNodes", 
"cssClass": "icon-time", "disabled": false, "context": "DATANODE"},
             {"action": "reassignMaster", "context": "NAMENODE", "label": "Move 
NameNode", "cssClass": "icon-share-alt", "disabled": true},
             {"action": "reassignMaster", "context": "SECONDARY_NAMENODE", 
"label": "Move SNameNode", "cssClass": "icon-share-alt", "disabled": true},
-            {"action": "enableHighAvailability", "label": "Enable NameNode 
HA", "cssClass": "icon-arrow-up", "isHidden": false, "disabled": true,},
+            {"action": "enableHighAvailability", "label": "Enable NameNode 
HA", "cssClass": "icon-arrow-up", "isHidden": false, "disabled": true},
             {"action": "runSmokeTest", "label": "Run Service Check", 
"cssClass": "icon-thumbs-up-alt"},
             {"action": "turnOnOffPassive", "context": "Turn On Maintenance 
Mode for HDFS", "label": "Turn On Maintenance Mode", "cssClass": "icon-medkit", 
"disabled": false},
             {"action": "rebalanceHdfsNodes", "customCommand": "REBALANCEHDFS", 
"context": "Rebalance HDFS", "label": "Rebalance HDFS", "cssClass": 
"icon-refresh", "disabled": false},
@@ -117,6 +118,7 @@ describe('App.MainServiceItemView', function () {
           serviceName: "ZOOKEEPER",
           displayName: "ZooKeeper",
           serviceTypes: [],
+          slaveComponents: [],
           hostComponents: [
             Em.Object.create({
               componentName: 'ZOOKEEPER_CLIENT',
@@ -145,6 +147,12 @@ describe('App.MainServiceItemView', function () {
           serviceName: "YARN",
           displayName: "YARN",
           serviceTypes: ['HA_MODE'],
+          slaveComponents: [
+            Em.Object.create({
+              componentName: 'NODEMANAGER',
+              totalCount: 1
+            })
+          ],
           hostComponents: [
             Em.Object.create({
               componentName: 'APP_TIMELINE_SERVER',
@@ -152,11 +160,6 @@ describe('App.MainServiceItemView', function () {
               isSlave: false
             }),
             Em.Object.create({
-              componentName: 'NODEMANAGER',
-              isMaster: false,
-              isSlave: true
-            }),
-            Em.Object.create({
               componentName: 'RESOURCEMANAGER',
               isMaster: true,
               isSlave: false
@@ -183,6 +186,7 @@ describe('App.MainServiceItemView', function () {
           serviceName: "MAPREDUCE2",
           displayName: "MapReduce2",
           serviceTypes: [],
+          slaveComponents: [],
           hostComponents: [
             Em.Object.create({
               componentName: 'HISTORYSERVER',
@@ -206,6 +210,7 @@ describe('App.MainServiceItemView', function () {
           serviceName: "KAFKA",
           displayName: "Kafka",
           serviceTypes: [],
+          slaveComponents: [],
           hostComponents: [
             Em.Object.create({
               componentName: 'KAFKA_BROKER',
@@ -224,13 +229,14 @@ describe('App.MainServiceItemView', function () {
           serviceName: "FLUME",
           displayName: "Flume",
           serviceTypes: [],
-          hostComponents: [
+          slaveComponents: [
             Em.Object.create({
               componentName: 'FLUME_HANDLER',
-              isMaster: false,
-              isSlave: true
+              totalCount: 1
             })
           ],
+          hostComponents: [
+          ],
           controller: [
             {'addDisabledTooltipFLUME_HANDLER': ''},
             {'isAddDisabled-FLUME_HANDLER': ''}
@@ -249,6 +255,12 @@ describe('App.MainServiceItemView', function () {
           serviceName: "HBASE",
           displayName: "HBase",
           serviceTypes: [],
+          slaveComponents: [
+            Em.Object.create({
+              componentName: 'HBASE_REGIONSERVER',
+              totalCount: 1
+            })
+          ],
           hostComponents: [
             Em.Object.create({
               componentName: 'HBASE_CLIENT',
@@ -259,11 +271,6 @@ describe('App.MainServiceItemView', function () {
               componentName: 'HBASE_MASTER',
               isMaster: true,
               isSlave: false
-            }),
-            Em.Object.create({
-              componentName: 'HBASE_REGIONSERVER',
-              isMaster: false,
-              isSlave: true
             })
           ],
           controller: [
@@ -283,6 +290,7 @@ describe('App.MainServiceItemView', function () {
           serviceName: "OOZIE",
           displayName: "Oozie",
           serviceTypes: [],
+          slaveComponents: [],
           hostComponents: [
             Em.Object.create({
               componentName: 'OOZIE_CLIENT',
@@ -307,6 +315,7 @@ describe('App.MainServiceItemView', function () {
           serviceName: "KNOX",
           displayName: "Knox",
           serviceTypes: [],
+          slaveComponents: [],
           hostComponents: [
             Em.Object.create({
               componentName: 'KNOX_GATEWAY',
@@ -392,6 +401,7 @@ describe('App.MainServiceItemView', function () {
           controller: Em.Object.create({
             content: Em.Object.create({
               hostComponents: testCase.hostComponents,
+              slaveComponents: testCase.slaveComponents,
               serviceName: testCase.serviceName,
               displayName: testCase.displayName,
               serviceTypes: testCase.serviceTypes,

Reply via email to