You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2014/02/10 18:49:08 UTC

git commit: AMBARI-4580 YARN ATS: Allow to install only for 2.1.1 stack version. (Denys Buzhor via ababiichuk)

Updated Branches:
  refs/heads/trunk 2e2b7153f -> 84fba7b22


AMBARI-4580 YARN ATS: Allow to install only for 2.1.1 stack version. (Denys Buzhor via ababiichuk)


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

Branch: refs/heads/trunk
Commit: 84fba7b22d0ded0a30c7b4f191b69432abe96acb
Parents: 2e2b715
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Mon Feb 10 19:48:47 2014 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Mon Feb 10 19:48:47 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/app.js                           | 65 ++++++++++++++++++
 .../controllers/main/service/info/configs.js    | 11 +++-
 .../app/controllers/wizard/step8_controller.js  |  2 +-
 ambari-web/app/data/HDP2/global_properties.js   | 69 ++++++++++----------
 ambari-web/app/data/review_configs.js           | 10 ++-
 ambari-web/app/data/service_components.js       |  2 +
 6 files changed, 120 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/84fba7b2/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 451cd1a..c42e70b 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -74,6 +74,71 @@ module.exports = Em.Application.create({
   }.property('router.clusterController.isLoaded'),
 
   /**
+   * List of exlcuded components for the current stack.
+   * Setup available versions by 'stackVersions' property.
+   *
+   * For example:
+   *  {
+   *   service_name: 'YARN',
+   *   component_name: 'APP_TIMELINE_SERVER',
+   *   display_name: 'App Timeline Server',
+   *   isMaster: true,
+   *   isClient: false,
+   *   stackVersions: ['2.1.1'], - this component available only for HDP-2.1.1 stack
+   *   description: ''
+   *  }
+   *
+   * @type {Array}
+   */
+  stackDependedComponents: [],
+  /**
+   * Resolve dependency in components. Check forbidden components and
+   * remove related data.
+   */
+  handleStackDependedComponents: function() {
+    var stackVersion, stackDependedComponents;
+    stackVersion = this.get('currentStackVersionNumber');
+    stackDependedComponents = [];
+    require('data/service_components').filterProperty('stackVersions').forEach(function(component) {
+      if (!component.stackVersions.contains(stackVersion))
+        stackDependedComponents.push(component);
+    });
+    if (stackDependedComponents.length > 0) {
+      // start clean info about each component
+      stackDependedComponents.forEach(function(component) {
+        // remove component from service_components list
+        require('data/service_components').removeObject(require('data/service_components').findProperty('component_name', component.component_name));
+        var serviceConfig = require('data/service_configs').findProperty('serviceName', component.service_name);
+        var serviceConfigsCategoryName, requirePrefix, propertyFileNames;
+        propertyFileNames = ['global_properties', 'site_properties'];
+        // remove config category assigned to this component
+        serviceConfig.configCategories = serviceConfig.configCategories.filter(function(configCategory) {
+          if (configCategory.get('hostComponentNames')) {
+            serviceConfigsCategoryName = configCategory.get('name');
+            return !configCategory.get('hostComponentNames').contains(component.component_name);
+          }
+          else
+            return true;
+        });
+        requirePrefix = this.get('isHadoop2Stack') ? 'data/HDP2/' : 'data/';
+        // remove config properties related to this component
+        propertyFileNames.forEach(function(propertyFileName) {
+          var properties = require(requirePrefix + propertyFileName);
+          properties.configProperties = properties.configProperties.filter(function(property) {
+            return property.category != serviceConfigsCategoryName;
+          });
+        });
+        // remove component from review configs
+        var reviewConfigsService = require('data/review_configs').findProperty('config_name', 'services').config_value.findProperty('service_name', component.service_name);
+        reviewConfigsService.set('service_components', reviewConfigsService.get('service_components').filter(function (serviceComponent) {
+          return serviceComponent.get('component_name') != component.component_name;
+        }));
+      }, this);
+    }
+    this.set('stackDependedComponents', stackDependedComponents);
+  }.observes('currentStackVersion'),
+
+  /**
    * List of components with allowed action for them
    * @type {Em.Object}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/84fba7b2/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 874683a..1a7af6f 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1499,7 +1499,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
    * @return {Object}
    */
   createGlobalSiteObj: function (tagName, globalConfigs) {
-    var heapsizeException = ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize'];
+    var heapsizeException = ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize', 'apptimelineserver_heapsize'];
     var globalSiteProperties = {};
     globalConfigs.forEach(function (_globalSiteObj) {
       // do not pass any globalConfigs whose name ends with _host or _hosts
@@ -1676,6 +1676,12 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
         break;
       case 'YARN':
         var resourceManagerHost = serviceConfigs.findProperty('name', 'rm_host');
+        var ATSHost = this.getMasterComponentHostValue('APP_TIMELINE_SERVER');
+        if (ATSHost) {
+          var ATSProperty = serviceConfigs.findProperty('name', 'ats_host');
+          ATSProperty.defaultValue = ATSHost
+          globalConfigs.push(ATSProperty);
+        }
         resourceManagerHost.defaultValue = this.get('content.hostComponents').findProperty('componentName', 'RESOURCEMANAGER').get('host.hostName');
         globalConfigs.push(resourceManagerHost);
         //yarn.log.server.url config dependent on HistoryServer host
@@ -1750,7 +1756,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
   },
 
   getMasterComponentHostValue: function(componentName) {
-    return this.get('content.hostComponents').findProperty('componentName', componentName).get('host.hostName')
+    var component = this.get('content.hostComponents').findProperty('componentName', componentName);
+    return component ? component.get('host.hostName') : false;
   },
   /**
    * Provides service component name and display-name information for

http://git-wip-us.apache.org/repos/asf/ambari/blob/84fba7b2/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 a2e76d8..1957bb2 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1218,7 +1218,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     }
     
     globalSiteObj.forEach(function (_globalSiteObj) {
-      var heapsizeException =  ['hadoop_heapsize','yarn_heapsize','nodemanager_heapsize','resourcemanager_heapsize'];
+      var heapsizeException =  ['hadoop_heapsize','yarn_heapsize','nodemanager_heapsize','resourcemanager_heapsize', 'apptimelineserver_heapsize'];
       // do not pass any globals whose name ends with _host or _hosts
       if (_globalSiteObj.isRequiredByAgent !== false) {
         // append "m" to JVM memory options except for hadoop_heapsize

http://git-wip-us.apache.org/repos/asf/ambari/blob/84fba7b2/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 2b00b87..35367da 100644
--- a/ambari-web/app/data/HDP2/global_properties.js
+++ b/ambari-web/app/data/HDP2/global_properties.js
@@ -414,18 +414,18 @@ module.exports =
 //    },
 //    {
 //      "id": "puppet var",
-//      "name": "ats_server_port",
-//      "displayName": "Server port",
-//      "description": "Application Timeline Server port",
-//      "defaultValue": "9292", // @todo add correct value APP_TIMELINE_SERVER.port
+//      "name": "apptimelineserver_heapsize",
+//      "displayName": "AppTimelineServer Java heap size",
+//      "description": "AppTimelineServer Java heap size",
+//      "defaultValue": "1024",
 //      "isOverridable": false,
 //      "displayType": "int",
-//      "isRequiredByAgent": false,
+//      "unit": "MB",
 //      "isVisible": true,
 //      "serviceName": "YARN",
 //      "category": "AppTimelineServer",
 //      "index": 1
-//    },
+//    }
   /**********************************************HBASE***************************************/
     {
       "id": "puppet var",
@@ -1761,32 +1761,33 @@ module.exports =
 // @todo remove after App Timeline service integration
 if (App.supports.appTimelineServer) {
   module.exports.configProperties.push(
-      {
-        "id": "puppet var",
-        "name": "ats_host",
-        "displayName": "App Timeline Server",
-        "description": "Application Timeline Server Host",
-        "defaultValue": "",
-        "isOverridable": false,
-        "displayType": "masterHost",
-        "isRequiredByAgent": false,
-        "isVisible": true,
-        "serviceName": "YARN",
-        "category": "AppTimelineServer",
-        "index": 0
-      },
-      {
-        "id": "puppet var",
-        "name": "ats_server_port",
-        "displayName": "Server port",
-        "description": "Application Timeline Server port",
-        "defaultValue": "9292",
-        "isOverridable": false,
-        "displayType": "int",
-        "isRequiredByAgent": false,
-        "isVisible": true,
-        "serviceName": "YARN",
-        "category": "AppTimelineServer",
-        "index": 1
-      });
+    {
+      "id": "puppet var",
+      "name": "ats_host",
+      "displayName": "App Timeline Server",
+      "description": "Application Timeline Server Host",
+      "defaultValue": "",
+      "isOverridable": false,
+      "displayType": "masterHost",
+      "isRequiredByAgent": false,
+      "isVisible": true,
+      "serviceName": "YARN",
+      "category": "AppTimelineServer",
+      "index": 0
+    },
+    {
+      "id": "puppet var",
+      "name": "apptimelineserver_heapsize",
+      "displayName": "AppTimelineServer Java heap size",
+      "description": "AppTimelineServer Java heap size",
+      "defaultValue": "1024",
+      "isOverridable": false,
+      "displayType": "int",
+      "unit": "MB",
+      "isVisible": true,
+      "serviceName": "YARN",
+      "category": "AppTimelineServer",
+      "index": 1
+    }
+  );
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/84fba7b2/ambari-web/app/data/review_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/review_configs.js b/ambari-web/app/data/review_configs.js
index acace78..8f7c2cd 100644
--- a/ambari-web/app/data/review_configs.js
+++ b/ambari-web/app/data/review_configs.js
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var App = require('app');
+
 module.exports = [
 
   {
@@ -127,7 +129,9 @@ module.exports = [
           // @todo uncomment after Application Timeline Server API implementation
 //          Ember.Object.create({
 //            display_name: 'App Timeline Server',
-//            component_value: ''
+//            component_name: 'APP_TIMELINE_SERVER',
+//            component_value: '',
+//            isMaster: true
 //          })
         ]
       }),
@@ -339,7 +343,9 @@ if (App.supports.appTimelineServer) {
   yarnServiceComponents.push(
     Ember.Object.create({
       display_name: 'App Timeline Server',
-      component_value: ''
+      component_name: "APP_TIMELINE_SERVER",
+      component_value: '',
+      isMaster: true
     })
   )
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/84fba7b2/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 1efe894..8e53fea 100644
--- a/ambari-web/app/data/service_components.js
+++ b/ambari-web/app/data/service_components.js
@@ -131,6 +131,7 @@ module.exports = new Ember.Set([
 //    display_name: 'App Timeline Server',
 //    isMaster: true,
 //    isClient: false,
+//    stackVersions: ['2.1.1'],
 //    description: ''
 //  },
   {
@@ -407,6 +408,7 @@ if (App.supports.appTimelineServer) {
     display_name: 'App Timeline Server',
     isMaster: true,
     isClient: false,
+    stackVersions: ['2.1.1'],
     description: ''
   };
   module.exports.push(appTimelineServerObj);