ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject [1/2] git commit: AMBARI-4506 Add properties to storm-site.xml for Storm metrics. (Denys Buzhor)
Date Mon, 03 Feb 2014 16:52:36 GMT
Updated Branches:
  refs/heads/trunk 0de2e012b -> aa25d928f


AMBARI-4506 Add properties to storm-site.xml for Storm metrics. (Denys Buzhor)


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

Branch: refs/heads/trunk
Commit: aa25d928faa0251754acf830f3a83c68b0292cc9
Parents: a127257
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Mon Feb 3 18:51:52 2014 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Mon Feb 3 18:52:21 2014 +0200

----------------------------------------------------------------------
 .../services/STORM/configuration/storm-site.xml |  6 ++--
 .../app/controllers/wizard/step7_controller.js  | 35 ++++++++++++++++++++
 .../app/controllers/wizard/step8_controller.js  |  9 +++--
 ambari-web/app/data/HDP2/site_properties.js     | 21 +++++++-----
 .../storm_defaults_provider.js                  |  8 +----
 .../validators/storm_configs_validator.js       | 17 +---------
 6 files changed, 59 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/aa25d928/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/configuration/storm-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/configuration/storm-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/configuration/storm-site.xml
index f81b3c3..de0a00c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/configuration/storm-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/configuration/storm-site.xml
@@ -113,7 +113,7 @@
   </property>
   <property>
     <name>nimbus.childopts</name>
-    <value>-Xmx1024m</value>
+    <value></value>
     <description></description>
   </property>
   <property>
@@ -243,7 +243,7 @@
   </property>
   <property>
     <name>supervisor.childopts</name>
-    <value>-Xmx256m</value>
+    <value></value>
     <description></description>
   </property>
   <property>
@@ -273,7 +273,7 @@
   </property>
   <property>
     <name>worker.childopts</name>
-    <value>-Xmx768m</value>
+    <value></value>
     <description></description>
   </property>
   <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/aa25d928/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index afd186d..f75c15b 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -308,7 +308,39 @@ App.WizardStep7Controller = Em.Controller.extend({
       }
     }
   },
+  /**
+   *  Resolve dependency between configs.
+   *  @param serviceName {String}
+   *  @param configs {Mixed}
+   */
+  resolveServiceDependencyConfigs: function (serviceName, configs) {
+    switch (serviceName) {
+      case 'STORM':
+        this.resolveStormConfigs(configs);
+        break;
+      default:
+        break;
+    }
+  },
 
+  resolveStormConfigs: function(configs) {
+    var dependentConfigs, gangliaServerHost;
+    dependentConfigs = ['nimbus.childopts', 'supervisor.childopts', 'worker.childopts'];
+    // if Ganglia selected or installed, set ganglia host to configs
+    if (this.get('installedServiceNames').contains('STORM') && this.get('installedServiceNames').contains('GANGLIA'))
return;
+    if (this.get('allSelectedServiceNames').contains('GANGLIA') || this.get('installedServiceNames').contains('GANGLIA'))
{
+      gangliaServerHost = this.get('wizardController').getDBProperty('masterComponentHosts').findProperty('component',
'GANGLIA_SERVER').hostName;
+      dependentConfigs.forEach(function(configName){
+        var config = configs.findProperty('name', configName);
+        config.value = config.defaultValue.format(gangliaServerHost);
+      }, this);
+    } else {
+      // if Ganglia not selected remove config
+      dependentConfigs.forEach(function(configName){
+        configs.removeAt(configs.indexOf(configs.findProperty('name', configName)));
+      }, this);
+    }
+  },
   /**
    * On load function
    */
@@ -339,6 +371,9 @@ App.WizardStep7Controller = Em.Controller.extend({
       this.getConfigTags();
       this.setInstalledServiceConfigs(this.get('serviceConfigTags'), configs);
     }
+    if (this.get('allSelectedServiceNames').contains('STORM') || this.get('installedServiceNames').contains('STORM'))
{
+      this.resolveServiceDependencyConfigs('STORM', configs);
+    }
     //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty
(configs -> serviceConfigs)
     var serviceConfigs = App.config.renderConfigs(configs, storedConfigs, this.get('allSelectedServiceNames'),
this.get('installedServiceNames'), localDB);
     if (this.get('wizardController.name') === 'addServiceController') {

http://git-wip-us.apache.org/repos/asf/ambari/blob/aa25d928/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 0052f44..e8da981 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1385,9 +1385,14 @@ App.WizardStep8Controller = Em.Controller.extend({
   createStormSiteObj: function () {
     var configs = this.get('configs').filterProperty('filename', 'storm-site.xml');
     var stormProperties = {};
+    var specialProperties = ["storm.zookeeper.servers", "nimbus.childopts", "supervisor.childopts",
"worker.childopts"];
     configs.forEach(function (_configProperty) {
-      if (_configProperty.name == "storm.zookeeper.servers") {
-        stormProperties[_configProperty.name] = JSON.stringify(_configProperty.value).replace(/"/g,
"'");
+      if (specialProperties.contains(_configProperty.name)) {
+        if (_configProperty.name == "storm.zookeeper.servers") {
+          stormProperties[_configProperty.name] = JSON.stringify(_configProperty.value).replace(/"/g,
"'");
+        } else {
+          stormProperties[_configProperty.name] = JSON.stringify(_configProperty.value).replace(/"/g,"");
+        }
       } else {
         stormProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/aa25d928/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 8cfdd07..afa4838 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -981,12 +981,13 @@ module.exports =
       "name": "nimbus.childopts",
       "displayName": "nimbus.childopts",
       "description": "",
-      "defaultValue": "",
+      "defaultValue": "-javaagent:/var/lib/storm/jmxetric-1.0.4.jar=host={0},port=8649,wireformat31x=true,mode=multicast,config=/var/lib/storm/jmxetric-conf.xml,process=Nimbus_JVM
-Xmx1024m",
       "isReconfigurable": true,
-      "isVisible": true,
+      "isVisible": false,
       "isRequiredByAgent": true,
       "serviceName": "STORM",
-      "category": "Nimbus"
+      "category": "Nimbus",
+      "filename": "storm-site.xml"
     },
     {
       "id": "site property",
@@ -1128,14 +1129,15 @@ module.exports =
       "id":"site property",
       "description":"",
       "isReconfigurable": true,
-      "isVisible":true,
+      "isVisible":false,
       "isRequiredByAgent":true,
       "serviceName":"STORM",
       "category":"Supervisor",
       "displayName":"supervisor.childopts",
       "name":"supervisor.childopts",
-      "defaultValue":"-Xmx256m",
-      "displayType":"string"
+      "defaultValue":"-javaagent:/var/lib/storm/jmxetric-1.0.4.jar=host={0},port=8650,wireformat31x=true,mode=multicast,config=/var/lib/storm/jmxetric-conf.xml,process=Supervisor_JVM
-Xmx256m",
+      "displayType":"string",
+      "filename": "storm-site.xml"
     },
     {
       "id":"site property",
@@ -1354,14 +1356,15 @@ module.exports =
       "id": "site property",
       "description": "",
       "isReconfigurable": true,
-      "isVisible": true,
+      "isVisible": false,
       "isRequiredByAgent": true,
       "serviceName": "STORM",
       "category": "Advanced",
       "displayName": "worker.childopts",
       "name": "worker.childopts",
-      "defaultValue": "-Xmx768m",
-      "displayType": "string"
+      "defaultValue": "-javaagent:/var/lib/storm/jmxetric-1.0.4.jar=host={0},port=8650,wireformat31x=true,mode=multicast,config=/var/lib/storm/jmxetric-conf.xml,process=Worker_%ID%_JVM
-Xmx768m",
+      "displayType": "string",
+      "filename": "storm-site.xml"
     },
 
   /**********************************************tez-site***************************************/

http://git-wip-us.apache.org/repos/asf/ambari/blob/aa25d928/ambari-web/app/utils/configs/defaults_providers/storm_defaults_provider.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/defaults_providers/storm_defaults_provider.js b/ambari-web/app/utils/configs/defaults_providers/storm_defaults_provider.js
index 196defd..cdd8ab9 100644
--- a/ambari-web/app/utils/configs/defaults_providers/storm_defaults_provider.js
+++ b/ambari-web/app/utils/configs/defaults_providers/storm_defaults_provider.js
@@ -26,12 +26,9 @@ App.STORMDefaultsProvider = App.DefaultsProvider.create({
    * List of the configs that should be calculated
    */
   configsTemplate: {
-    'supervisor.childopts': null,
-    'nimbus.childopts': null,
     'drpc.childopts': null,
     'ui.childopts': null,
-    'logviewer.childopts': null,
-    'worker.childopts': null
+    'logviewer.childopts': null
   },
 
   // @todo fill with correct values
@@ -43,12 +40,9 @@ App.STORMDefaultsProvider = App.DefaultsProvider.create({
     if (!this.clusterDataIsValid()) {
       return configs;
     }
-    configs['supervisor.childopts'] = '-Xmx256m';
-    configs['nimbus.childopts'] = '-Xmx1024m';
     configs['drpc.childopts'] = '-Xmx768m';
     configs['ui.childopts'] = '-Xmx768m';
     configs['logviewer.childopts'] = '-Xmx128m';
-    configs['worker.childopts'] = '-Xmx768m';
     return configs;
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/aa25d928/ambari-web/app/utils/configs/validators/storm_configs_validator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/validators/storm_configs_validator.js b/ambari-web/app/utils/configs/validators/storm_configs_validator.js
index 69fe18b..a2470f5 100644
--- a/ambari-web/app/utils/configs/validators/storm_configs_validator.js
+++ b/ambari-web/app/utils/configs/validators/storm_configs_validator.js
@@ -23,20 +23,9 @@ App.STORMConfigsValidator = App.ServiceConfigsValidator.create({
    * List of the configs that should be validated
    */
   configValidators: {
-    'supervisor.childopts': 'supervisorChildOpts',
-    'nimbus.childopts': 'nimbusChildOpts',
     'drpc.childopts': 'drpcChildOpts',
     'ui.childopts': 'uiChildOpts',
-    'logviewer.childopts': 'logviewerChildOpts',
-    'worker.childopts': 'workerChildOpts'
-  },
-
-  supervisorChildOpts: function(config) {
-    return this.validateXmxValue(config);
-  },
-
-  nimbusChildOpts: function(config) {
-    return this.validateXmxValue(config);
+    'logviewer.childopts': 'logviewerChildOpts'
   },
 
   drpcChildOpts: function(config) {
@@ -49,9 +38,5 @@ App.STORMConfigsValidator = App.ServiceConfigsValidator.create({
 
   logviewerChildOpts: function(config) {
     return this.validateXmxValue(config);
-  },
-
-  workerChildOpts: function(config) {
-    return this.validateXmxValue(config);
   }
 });


Mime
View raw message