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/02/26 00:14:41 UTC

git commit: AMBARI-4826. Falcon: expose custom startup.properties and runtime.properties. (jaimin)

Repository: ambari
Updated Branches:
  refs/heads/trunk 6d522cb9d -> a9bd17354


AMBARI-4826. Falcon: expose custom startup.properties and runtime.properties. (jaimin)


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

Branch: refs/heads/trunk
Commit: a9bd173545063df979148c6593c55ef8439a40b4
Parents: 6d522cb
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Tue Feb 25 15:13:58 2014 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Tue Feb 25 15:13:58 2014 -0800

----------------------------------------------------------------------
 .../services/FALCON/package/scripts/falcon.py   |  4 +--
 .../app/controllers/wizard/step8_controller.js  | 22 ++++++++++++-----
 ambari-web/app/data/HDP2/global_properties.js   | 26 ++++++++++++++++++++
 ambari-web/app/data/service_configs.js          |  4 ++-
 4 files changed, 47 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a9bd1735/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/package/scripts/falcon.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/package/scripts/falcon.py b/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/package/scripts/falcon.py
index ead884d..8596aa3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/package/scripts/falcon.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/package/scripts/falcon.py
@@ -57,13 +57,13 @@ def falcon(type, action = None):
                      mode=0644
       )
     if action == 'start':
-      Execute(format('env JAVA_HOME={java_home} FALCON_LOG_DIR=/var/log/falcon '
+      Execute(format('env JAVA_HOME={java_home} FALCON_LOG_DIR={falcon_log_dir} '
                      'FALCON_PID_DIR=/var/run/falcon FALCON_DATA_DIR={falcon_data_dir} '
                      '{falcon_home}/bin/falcon-start -port {falcon_port}'),
               user=params.falcon_user
       )
     if action == 'stop':
-      Execute(format('env JAVA_HOME={java_home} FALCON_LOG_DIR=/var/log/falcon '
+      Execute(format('env JAVA_HOME={java_home} FALCON_LOG_DIR={falcon_log_dir} '
                      'FALCON_PID_DIR=/var/run/falcon FALCON_DATA_DIR={falcon_data_dir} '
                      '{falcon_home}/bin/falcon-stop'),
               user=params.falcon_user

http://git-wip-us.apache.org/repos/asf/ambari/blob/a9bd1735/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 4740913..473cbb3 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1094,7 +1094,8 @@ App.WizardStep8Controller = Em.Controller.extend({
       this.get('serviceConfigTags').pushObject(this.createLog4jObj('PIG'));
     }
     if (selectedServices.someProperty('serviceName', 'FALCON')) {
-      this.get('serviceConfigTags').pushObject(this.createFalconSiteObj('FALCON'));
+      this.get('serviceConfigTags').pushObject(this.createFalconStartupSiteObj('FALCON'));
+      this.get('serviceConfigTags').pushObject(this.createFalconRuntimeSiteObj('FALCON'));
     }
     if (selectedServices.someProperty('serviceName', 'STORM')) {
       this.get('serviceConfigTags').pushObject(this.createStormSiteObj());
@@ -1430,13 +1431,22 @@ App.WizardStep8Controller = Em.Controller.extend({
   },
 
 
-  createFalconSiteObj: function (s) {
-    var configs = this.get('configs').filterProperty('filename', 'oozie-site.xml');
-    var falconProperties = {};
+  createFalconStartupSiteObj: function (s) {
+    var configs = this.get('configs').filterProperty('filename', 'falcon-startup.properties.xml');
+    var falconStartupProperties = {};
+    configs.forEach(function (_configProperty) {
+      falconStartupProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
+    }, this);
+    return {type: 'falcon-startup.properties', tag: 'version1', properties: falconStartupProperties};
+  },
+
+  createFalconRuntimeSiteObj: function (s) {
+    var configs = this.get('configs').filterProperty('filename', 'falcon-runtime.properties.xml');
+    var falconRuntimeProperties = {};
     configs.forEach(function (_configProperty) {
-      falconProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
+      falconRuntimeProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
     }, this);
-    return {type: 'oozie-site', tag: 'version' + (new Date()).getTime(), properties: falconProperties};
+    return {type: 'falcon-runtime.properties', tag: 'version1', properties: falconRuntimeProperties};
   },
 
   ajaxQueueFinished: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a9bd1735/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 bb7dd04..07d3a51 100644
--- a/ambari-web/app/data/HDP2/global_properties.js
+++ b/ambari-web/app/data/HDP2/global_properties.js
@@ -1376,6 +1376,32 @@ module.exports =
       "serviceName": "FALCON",
       "category": "Falcon"
     },
+    {
+      "id": "puppet var",
+      "name": "falcon_log_dir",
+      "displayName": "Falcon Log Dir",
+      "description": "Directory for Falcon logs",
+      "defaultValue": "/var/log/falcon",
+      "displayType": "directory",
+      "isOverridable": false,
+      "isVisible": true,
+      "isRequiredByAgent": true,
+      "serviceName": "FALCON",
+      "category": "Advanced"
+    },
+    {
+      "id": "puppet var",
+      "name": "falcon_pid_dir",
+      "displayName": "Falcon PID Dir",
+      "description": "Directory in which the pid files for Falcon processes will be created",
+      "defaultValue": "/var/run/falcon",
+      "displayType": "directory",
+      "isOverridable": false,
+      "isVisible": true,
+      "isRequiredByAgent": true,
+      "serviceName": "FALCON",
+      "category": "Advanced"
+    },
   /**********************************************STORM***************************************/
     {
       "id": "puppet var",

http://git-wip-us.apache.org/repos/asf/ambari/blob/a9bd1735/ambari-web/app/data/service_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/service_configs.js b/ambari-web/app/data/service_configs.js
index 803d6df..b00ae6c 100644
--- a/ambari-web/app/data/service_configs.js
+++ b/ambari-web/app/data/service_configs.js
@@ -226,7 +226,9 @@ module.exports = [
     configCategories: [
       App.ServiceConfigCategory.create({ name: 'Falcon', displayName : 'Falcon Server'}),
       App.ServiceConfigCategory.create({ name: 'Falcon - Oozie integration', displayName : 'Falcon - Oozie integration'}),
-      App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'})
+      App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
+      App.ServiceConfigCategory.create({ name: 'AdvancedFalconStartupSite', displayName : 'Custom startup.properties', siteFileName: 'falcon-startup.properties.xml', canAddProperty: true}),
+      App.ServiceConfigCategory.create({ name: 'AdvancedFalconRuntimeSite', displayName : 'Custom runtime.properties', siteFileName: 'falcon-runtime.properties.xml', canAddProperty: true})
     ],
     sites: ['global', 'oozie-site'],
     configs: []