You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/01/20 18:33:43 UTC

git commit: AMBARI-4353. Storm: Change Supervisor component category from "Client" to "Slave". (Denys Buzhor via akovalenko)

Updated Branches:
  refs/heads/trunk 6974a6be3 -> fd4234651


AMBARI-4353. Storm: Change Supervisor component category from "Client" to "Slave".  (Denys Buzhor via akovalenko)


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

Branch: refs/heads/trunk
Commit: fd4234651d8db655743c6e302c68536ef43de203
Parents: 6974a6b
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon Jan 20 19:33:19 2014 +0200
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon Jan 20 19:33:19 2014 +0200

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    | 27 ++++++++++++++++++++
 .../app/controllers/wizard/step6_controller.js  |  6 +++++
 .../app/controllers/wizard/step8_controller.js  |  2 +-
 ambari-web/app/data/HDP2/global_properties.js   | 20 ++++++++++++---
 ambari-web/app/data/service_components.js       |  4 +--
 ambari-web/app/models/host_component.js         |  3 ++-
 ambari-web/app/models/service_config.js         |  4 +++
 ambari-web/app/views/main/host/summary.js       |  7 +++++
 8 files changed, 66 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fd423465/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index b0d5d4f..403436d 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1717,9 +1717,36 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         hiveMetastoreHost.defaultValue = App.Service.find('HIVE').get('hostComponents').findProperty('componentName', 'HIVE_SERVER').get('host.hostName');
         globalConfigs.push(hiveMetastoreHost);
         break;
+      case 'STORM':
+        var stormUIServerHost = this.getMasterComponentHostValue('STORM_UI_SERVER');
+        var logviewerServerHost = this.getMasterComponentHostValue('LOGVIEWER_SERVER');
+        var drpcServerHost = this.getMasterComponentHostValue('DRPC_SERVER');
+
+        var stormUIServerHostConfig = serviceConfigs.findProperty('name','stormuiserver_host');
+        var logviewerServerHostConfig = serviceConfigs.findProperty('name','logviewerserver_host');
+        var drpcServerHostConfig = serviceConfigs.findProperty('name','drpcserver_host');
+
+        stormUIServerHostConfig.defaultValue = stormUIServerHost;
+        logviewerServerHostConfig.defaultValue = logviewerServerHost;
+        drpcServerHostConfig.defaultValue = drpcServerHost;
+
+        globalConfigs.push(stormUIServerHostConfig);
+        globalConfigs.push(logviewerServerHostConfig);
+        globalConfigs.push(drpcServerHostConfig);
+
+        var supervisorHosts = this.get('content.hostComponents').filterProperty('componentName','SUPERVISOR').mapProperty('host.hostName');
+        if (supervisorHosts.length > 0) {
+          var supervisorHostsConfig = serviceConfigs.findProperty('name', 'supervisor_hosts');
+          supervisorHostsConfig.defaultValue = supervisorHosts;
+          globalConfigs.push(supervisorHostsConfig);
+        }
+        break;
     }
   },
 
+  getMasterComponentHostValue: function(componentName) {
+    return this.get('content.hostComponents').findProperty('componentName', componentName).get('host.hostName')
+  },
   /**
    * Provides service component name and display-name information for
    * the current selected service.

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd423465/ambari-web/app/controllers/wizard/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js
index aabf899..3bce938 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -234,6 +234,12 @@ App.WizardStep6Controller = Em.Controller.extend({
           label: self.getComponentDisplayName('HBASE_REGIONSERVER')
         }));
       }
+      if (this.isServiceSelected('STORM')) {
+        headers.pushObject(Em.Object.create({
+          name: 'SUPERVISOR',
+          label: self.getComponentDisplayName('SUPERVISOR')
+        }));
+      }
       headers.pushObject(Ember.Object.create({
         name: 'CLIENT',
         label: self.getComponentDisplayName('CLIENT')

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd423465/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 2675707..c33751e 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -945,7 +945,7 @@ App.WizardStep8Controller = Em.Controller.extend({
   },
 
   loadSuperVisorValue: function(component) {
-    var hostsCount = this.get('content.slaveComponentHosts').findProperty('componentName', 'CLIENT').hosts.length;
+    var hostsCount = this.get('content.slaveComponentHosts').findProperty('componentName', 'SUPERVISOR').hosts.length;
     var hostsText = hostsCount > 1 ? hostsCount + ' hosts' : hostsCount + ' host'
     component.set('component_value', hostsText);
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd423465/ambari-web/app/data/HDP2/global_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/global_properties.js b/ambari-web/app/data/HDP2/global_properties.js
index 04632ac..79c8193 100644
--- a/ambari-web/app/data/HDP2/global_properties.js
+++ b/ambari-web/app/data/HDP2/global_properties.js
@@ -1332,7 +1332,7 @@ module.exports =
       "displayType": "masterHost",
       "isReconfigurable": false,
       "isVisible": true,
-      "isRequiredByAgent": true,
+      "isRequiredByAgent": false,
       "serviceName": "STORM",
       "category": "StormUIServer"
     },
@@ -1345,7 +1345,7 @@ module.exports =
       "displayType": "masterHost",
       "isReconfigurable": false,
       "isVisible": true,
-      "isRequiredByAgent": true,
+      "isRequiredByAgent": false,
       "serviceName": "STORM",
       "category": "LogviewerServer"
     },
@@ -1358,10 +1358,24 @@ module.exports =
       "displayType": "masterHost",
       "isReconfigurable": false,
       "isVisible": true,
-      "isRequiredByAgent": true,
+      "isRequiredByAgent": false,
       "serviceName": "STORM",
       "category": "DRPCServer"
     },
+    {
+      "id": "puppet var",
+      "name": "supervisor_hosts",
+      "displayName": "Supervisor hosts",
+      "description": "",
+      "defaultValue": "",
+      "displayType": "masterHosts",
+      "isReconfigurable": false,
+      "isVisible": true,
+      "isRequiredByAgent": false,
+      "serviceName": "STORM",
+      "isOverridable": false,
+      "category": "Supervisor"
+    },
   /**********************************************MISC***************************************/
     {
       "id": "puppet var",

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd423465/ambari-web/app/data/service_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/service_components.js b/ambari-web/app/data/service_components.js
index b4c7e0e..0736f24 100644
--- a/ambari-web/app/data/service_components.js
+++ b/ambari-web/app/data/service_components.js
@@ -351,8 +351,8 @@ module.exports = new Ember.Set([
     component_name: 'SUPERVISOR',
     display_name: 'Supervisor',
     isMaster: false,
-    isClient: true,
-    description: 'Client component for STORM'
+    isClient: false,
+    description: 'Slave component for STORM'
   },
   {
     service_name: 'STORM',

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd423465/ambari-web/app/models/host_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js
index eee253f..17887ac 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -31,7 +31,7 @@ App.HostComponent = DS.Model.extend({
    * @returns {bool}
    */
   isClient:function () {
-    if(['PIG', 'SQOOP', 'HCAT', 'MAPREDUCE2_CLIENT','SUPERVISOR'].contains(this.get('componentName'))){
+    if(['PIG', 'SQOOP', 'HCAT', 'MAPREDUCE2_CLIENT'].contains(this.get('componentName'))){
       return true;
     }
 
@@ -101,6 +101,7 @@ App.HostComponent = DS.Model.extend({
       case 'GANGLIA_MONITOR':
       case 'NODEMANAGER':
       case 'ZKFC':
+      case 'SUPERVISOR':
         return true;
       default:
         return false;

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd423465/ambari-web/app/models/service_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config.js b/ambari-web/app/models/service_config.js
index 2c6928a..f673770 100644
--- a/ambari-web/app/models/service_config.js
+++ b/ambari-web/app/models/service_config.js
@@ -411,6 +411,10 @@ App.ServiceConfigProperty = Ember.Object.extend({
         if (!App.supports.storm) return; // @todo remove test mode check after Storm service integration
         this.set('value', masterComponentHostsInDB.findProperty('component', 'STORM_UI_SERVER').hostName);
         break;
+      case 'supervisor_hosts':
+        if (!App.supports.storm) return; // @todo remove test mode check after Storm service integration
+        this.set('value', slaveComponentHostsInDB.findProperty('componentName', 'SUPERVISOR').hosts.mapProperty('hostName'));
+        break;
       case 'hbase.zookeeper.quorum':
         var zkHosts = masterComponentHostsInDB.filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
         this.setDefaultValue("(\\w*)", zkHosts);

http://git-wip-us.apache.org/repos/asf/ambari/blob/fd423465/ambari-web/app/views/main/host/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js
index 15bc0ad..dada7e8 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -224,6 +224,7 @@ App.MainHostSummaryView = Em.View.extend({
     var zookeeperServerExists = false;
     var nodeManagerExists = false;
     var hbaseMasterExists = false;
+    var supervisorExists = false;
     
     var installableClients = this.get('installableClientComponents');
     
@@ -247,6 +248,9 @@ App.MainHostSummaryView = Em.View.extend({
         case 'HBASE_MASTER':
           hbaseMasterExists = true;
           break;
+        case 'SUPERVISOR':
+          supervisorExists = true;
+          break;
       }
     }, this);
 
@@ -268,6 +272,9 @@ App.MainHostSummaryView = Em.View.extend({
     if (!nodeManagerExists && services.findProperty('serviceName', 'YARN')) {
       components.pushObject(this.addableComponentObject.create({ 'componentName': 'NODEMANAGER' }));
     }
+    if (!supervisorExists && services.findProperty('serviceName', 'STORM')) {
+      components.pushObject(this.addableComponentObject.create({ 'componentName': 'SUPERVISOR' }));
+    }
     if (installableClients.length > 0) {
       components.pushObject(this.addableComponentObject.create({ 'componentName': 'CLIENTS', subComponentNames: installableClients }));
     }