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 2013/02/27 01:03:06 UTC

svn commit: r1450542 - in /incubator/ambari/trunk: ./ ambari-web/app/controllers/main/service/info/ ambari-web/app/controllers/wizard/ ambari-web/app/data/

Author: jaimin
Date: Wed Feb 27 00:03:05 2013
New Revision: 1450542

URL: http://svn.apache.org/r1450542
Log:
AMBARI-1508: Introduce a new section "Capacity scheduler" under MapReduce Service in step7 (Configure services) of Installer and Service Reconfig. (jaimin)

Added:
    incubator/ambari/trunk/ambari-web/app/data/capacity-scheduler_default.js
    incubator/ambari/trunk/ambari-web/app/data/mapred-queue-acl_default.js
Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js
    incubator/ambari/trunk/ambari-web/app/data/config_properties.js
    incubator/ambari/trunk/ambari-web/app/data/custom_configs.js
    incubator/ambari/trunk/ambari-web/app/data/service_configs.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1450542&r1=1450541&r2=1450542&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Feb 27 00:03:05 2013
@@ -12,6 +12,10 @@ Trunk (unreleased changes):
 
  NEW FEATURES
 
+ AMBARI-1508. Introduce a new section "Capacity scheduler" under MapReduce
+ Service in step7 (Configure services) of Installer and Service 
+ Reconfig. (jaimin)
+
  AMBARI-1490. Implement initial layout for "Add security" wizard. (jaimin)
 
  AMBARI-1483. Reassign Master Wizard - Step 2. (yusaku)

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js?rev=1450542&r1=1450541&r2=1450542&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js Wed Feb 27 00:03:05 2013
@@ -238,7 +238,7 @@ App.MainServiceInfoConfigsController = E
         var customValue = '';
         var length = this.get('customConfig').length;
         this.get('customConfig').forEach(function (_config, index) {
-          if ((_config.filename !== 'core-site.xml' && _customConfig.name !== 'core-site') || (_config.filename === 'core-site.xml' && _customConfig.name === 'core-site')) {
+          if (_config.filename === (_customConfig.name + '.xml')) {
             customValue += _config.name + '=' + _config.value;
             if (index !== length - 1) {
               customValue += '\n';
@@ -546,7 +546,7 @@ App.MainServiceInfoConfigsController = E
      return result;
      }
      */
-    result.flag =  this.createConfigurations();
+    result.flag = this.createConfigurations();
     if (result.flag === true) {
       if (this.get('content.serviceName') !== 'HDFS') {
         result.flag = this.applyCreatedConfToService(this.get('content.serviceName'));
@@ -1074,8 +1074,7 @@ App.MainServiceInfoConfigsController = E
     }
   }
 
-})
-;
+});
 
 
 App.MainServiceSlaveComponentGroupsController = App.SlaveComponentGroupsController.extend({

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js?rev=1450542&r1=1450541&r2=1450542&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step7_controller.js Wed Feb 27 00:03:05 2013
@@ -144,12 +144,27 @@ App.WizardStep7Controller = Em.Controlle
       var service = serviceConfigs.findProperty('serviceName', _config.serviceName);
       if (service) {
         if (!(service.configs.someProperty('name', _config.name))) {
+          if( Object.prototype.toString.call( _config.defaultValue ) === '[object Array]' ) {
+            this.loadDefaultCustomConfig(_config);
+          }
           service.configs.pushObject(_config);
         }
       }
     }, this);
   },
 
+  loadDefaultCustomConfig: function (customConfig) {
+    var customValue = '';
+    var length = customConfig.defaultValue.length;
+    customConfig.defaultValue.forEach(function (_config, index) {
+      customValue += _config.name + '=' + _config.value;
+      if (index !== length - 1) {
+        customValue += '\n';
+      }
+    }, this);
+    customConfig.value = customValue;
+  },
+
   /**
    * Render configs for active services
    * @param serviceConfigs
@@ -268,19 +283,19 @@ App.WizardStep7Controller = Em.Controlle
     var displayMsg = null;
     if (displayNames && displayNames.length) {
       if (displayNames.length === 1) {
-        displayMsg = siteProperty + ' '+Em.I18n.t('as')+' ' + displayNames[0];
+        displayMsg = siteProperty + ' ' + Em.I18n.t('as') + ' ' + displayNames[0];
       } else {
         var name = null;
         displayNames.forEach(function (_name, index) {
           if (index === 0) {
             name = _name;
           } else if (index === displayNames.length - 1) {
-            name = name + ' '+Em.I18n.t('and')+' ' + _name;
+            name = name + ' ' + Em.I18n.t('and') + ' ' + _name;
           } else {
             name = name + ', ' + _name;
           }
         }, this);
-        displayMsg = siteProperty + ' '+Em.I18n.t('as')+' ' + name;
+        displayMsg = siteProperty + ' ' + Em.I18n.t('as') + ' ' + name;
       }
     } else {
       displayMsg = siteProperty;
@@ -352,14 +367,14 @@ App.WizardStep7Controller = Em.Controlle
     if (!this.get('isSubmitDisabled')) {
       App.router.send('next');
       /*
-      var result = {};
-      result = this.validateCustomConfig();
-      if (result.flag === true) {
-        App.router.send('next');
-      } else {
-        this.showCustomConfigErrMsg(result.value);
-      }
-      */
+       var result = {};
+       result = this.validateCustomConfig();
+       if (result.flag === true) {
+       App.router.send('next');
+       } else {
+       this.showCustomConfigErrMsg(result.value);
+       }
+       */
     }
   }
 

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js?rev=1450542&r1=1450541&r2=1450542&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js Wed Feb 27 00:03:05 2013
@@ -223,6 +223,7 @@ App.WizardStep8Controller = Em.Controlle
     }
   },
 
+
   /**
    * override site properties with the entered key-value pair in *-site.xml
    */
@@ -252,12 +253,12 @@ App.WizardStep8Controller = Em.Controlle
    * Set property of the site variable
    */
   setSiteProperty: function (key, value, filename) {
-      this.get('configs').pushObject({
-        "id": "site property",
-        "name": key,
-        "value": value,
-        "filename": filename
-      });
+    this.get('configs').pushObject({
+      "id": "site property",
+      "name": key,
+      "value": value,
+      "filename": filename
+    });
   },
 
   loadSlaveConfiguration: function () {
@@ -607,7 +608,7 @@ App.WizardStep8Controller = Em.Controlle
 
   loadMasterValue: function (hbaseMaster) {
     var hbaseHostName = this.get('content.masterComponentHosts').filterProperty('display_name', 'HBase Master');
-    if(hbaseHostName.length == 1){
+    if (hbaseHostName.length == 1) {
       hbaseMaster.set('component_value', hbaseHostName[0].hostName);
     } else {
       hbaseMaster.set('component_value', hbaseHostName[0].hostName + Em.I18n.t('installer.step8.other').format(hbaseHostName.length - 1));
@@ -810,7 +811,7 @@ App.WizardStep8Controller = Em.Controlle
   /**
    * Used in progress bar
    */
-  ajaxQueueLength: function() {
+  ajaxQueueLength: function () {
     return this.get('ajaxQueue').length;
   }.property('ajaxQueue.length'),
 
@@ -856,7 +857,7 @@ App.WizardStep8Controller = Em.Controlle
       type: 'GET',
       url: url,
       async: false,
-      success: function(data) {
+      success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         clusterNames = jsonData.items.mapProperty('Clusters.cluster_name');
         console.log("Got existing cluster names: " + clusterNames);
@@ -870,7 +871,7 @@ App.WizardStep8Controller = Em.Controlle
   },
 
   deleteClusters: function (clusterNames) {
-    clusterNames.forEach(function(clusterName) {
+    clusterNames.forEach(function (clusterName) {
 
       var url = App.apiPrefix + '/clusters/' + clusterName;
 
@@ -1023,75 +1024,75 @@ App.WizardStep8Controller = Em.Controlle
       } else {
         clients.forEach(function (_client) {
 
-            var hostNames = _slave.hosts.mapProperty('hostName');
-            switch (_client.component_name) {
-              case 'HDFS_CLIENT':
-                // install HDFS_CLIENT on HBASE_MASTER, HBASE_REGIONSERVER, and WEBHCAT_SERVER hosts
-                masterHosts.filterProperty('component', 'HBASE_MASTER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                masterHosts.filterProperty('component', 'HBASE_REGIONSERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                break;
-              case 'MAPREDUCE_CLIENT':
-                // install MAPREDUCE_CLIENT on HIVE_SERVER, OOZIE_SERVER, NAGIOS_SERVER, and WEBHCAT_SERVER hosts
-                masterHosts.filterProperty('component', 'HIVE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                masterHosts.filterProperty('component', 'OOZIE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                break;
-              case 'OOZIE_CLIENT':
-                // install OOZIE_CLIENT on NAGIOS_SERVER host
-                masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                break;
-              case 'ZOOKEEPER_CLIENT':
-                // install ZOOKEEPER_CLIENT on WEBHCAT_SERVER host
-                masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                break;
-
-              case 'HIVE_CLIENT':
-                //install HIVE client on NAGIOS_SERVER host
-                masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                break;
-
-              case 'HCAT':
-                // install HCAT (client) on NAGIOS_SERVER host
-                masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
-                  hostNames.pushObject(_masterHost.hostName);
-                }, this);
-                break;
-            }
-            hostNames = hostNames.uniq();
+          var hostNames = _slave.hosts.mapProperty('hostName');
+          switch (_client.component_name) {
+            case 'HDFS_CLIENT':
+              // install HDFS_CLIENT on HBASE_MASTER, HBASE_REGIONSERVER, and WEBHCAT_SERVER hosts
+              masterHosts.filterProperty('component', 'HBASE_MASTER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              masterHosts.filterProperty('component', 'HBASE_REGIONSERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              break;
+            case 'MAPREDUCE_CLIENT':
+              // install MAPREDUCE_CLIENT on HIVE_SERVER, OOZIE_SERVER, NAGIOS_SERVER, and WEBHCAT_SERVER hosts
+              masterHosts.filterProperty('component', 'HIVE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              masterHosts.filterProperty('component', 'OOZIE_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              break;
+            case 'OOZIE_CLIENT':
+              // install OOZIE_CLIENT on NAGIOS_SERVER host
+              masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              break;
+            case 'ZOOKEEPER_CLIENT':
+              // install ZOOKEEPER_CLIENT on WEBHCAT_SERVER host
+              masterHosts.filterProperty('component', 'WEBHCAT_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              break;
 
-            if(_client.isInstalled){
-              //check whether clients are already installed on selected master hosts!!!
-              var installedHosts = _slave.hosts.filterProperty('isInstalled', true).mapProperty('hostName');
-              installedHosts.forEach(function(host){
-                if(hostNames.contains(host)){
-                  hostNames.splice(hostNames.indexOf(host), 1);
-                }
+            case 'HIVE_CLIENT':
+              //install HIVE client on NAGIOS_SERVER host
+              masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
               }, this);
-            }
+              break;
 
-            this.registerHostsToComponent(hostNames, _client.component_name);
+            case 'HCAT':
+              // install HCAT (client) on NAGIOS_SERVER host
+              masterHosts.filterProperty('component', 'NAGIOS_SERVER').filterProperty('isInstalled', false).forEach(function (_masterHost) {
+                hostNames.pushObject(_masterHost.hostName);
+              }, this);
+              break;
+          }
+          hostNames = hostNames.uniq();
+
+          if (_client.isInstalled) {
+            //check whether clients are already installed on selected master hosts!!!
+            var installedHosts = _slave.hosts.filterProperty('isInstalled', true).mapProperty('hostName');
+            installedHosts.forEach(function (host) {
+              if (hostNames.contains(host)) {
+                hostNames.splice(hostNames.indexOf(host), 1);
+              }
+            }, this);
+          }
+
+          this.registerHostsToComponent(hostNames, _client.component_name);
 
         }, this);
       }
@@ -1178,6 +1179,8 @@ App.WizardStep8Controller = Em.Controlle
     }
     if (selectedServices.someProperty('serviceName', 'MAPREDUCE')) {
       this.createConfigSiteForService(this.createMrSiteObj());
+      this.createConfigSiteForService(this.createCapacityScheduler());
+      this.createConfigSiteForService(this.createMapredQueue());
       //this.createMrSitePerSlaveGroup('MAPREDUCE');
     }
     if (selectedServices.someProperty('serviceName', 'HBASE')) {
@@ -1218,7 +1221,7 @@ App.WizardStep8Controller = Em.Controlle
       if (!/_hosts?$/.test(_globalSiteObj.name)) {
         // append "m" to JVM memory options except for hadoop_heapsize
         if (/_heapsize|_newsize|_maxnewsize$/.test(_globalSiteObj.name) && _globalSiteObj.name !== 'hadoop_heapsize') {
-          globalSiteProperties[_globalSiteObj.name] =  _globalSiteObj.value + "m";
+          globalSiteProperties[_globalSiteObj.name] = _globalSiteObj.value + "m";
         } else {
           globalSiteProperties[_globalSiteObj.name] = _globalSiteObj.value;
         }
@@ -1265,13 +1268,13 @@ App.WizardStep8Controller = Em.Controlle
     var coreSiteProperties = {};
     // hadoop.proxyuser.oozie.hosts needs to be skipped if oozie is not selected
     var isOozieSelected = this.get('selectedServices').someProperty('serviceName', 'OOZIE');
-    var oozieUser = this.get('globals').someProperty('name','oozie_user')  ? this.get('globals').findProperty('name','oozie_user').value : null;
+    var oozieUser = this.get('globals').someProperty('name', 'oozie_user') ? this.get('globals').findProperty('name', 'oozie_user').value : null;
     var isHiveSelected = this.get('selectedServices').someProperty('serviceName', 'HIVE');
-    var hiveUser = this.get('globals').someProperty('name','hive_user') ? this.get('globals').findProperty('name','hive_user').value : null;
+    var hiveUser = this.get('globals').someProperty('name', 'hive_user') ? this.get('globals').findProperty('name', 'hive_user').value : null;
     var isHcatSelected = this.get('selectedServices').someProperty('serviceName', 'WEBHCAT');
-    var hcatUser = this.get('globals').someProperty('name','hcat_user') ? this.get('globals').findProperty('name','hcat_user').value : null;
+    var hcatUser = this.get('globals').someProperty('name', 'hcat_user') ? this.get('globals').findProperty('name', 'hcat_user').value : null;
     coreSiteObj.forEach(function (_coreSiteObj) {
-      if ((isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser +'.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser +'.groups')) && (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser +'.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) && (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser +'.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
+      if ((isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.groups')) && (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) && (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
         coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
       }
       console.log("STEP*: name of the property is: " + _coreSiteObj.name);
@@ -1324,6 +1327,28 @@ App.WizardStep8Controller = Em.Controlle
     return {type: 'mapred-site', tag: 'version1', properties: mrProperties};
   },
 
+  createCapacityScheduler: function () {
+    var configs = this.get('configs').filterProperty('filename', 'capacity-scheduler.xml');
+    var csProperties = {};
+    configs.forEach(function (_configProperty) {
+      csProperties[_configProperty.name] = _configProperty.value;
+      console.log("STEP*: name of the property is: " + _configProperty.name);
+      console.log("STEP8: value of the property is: " + _configProperty.value);
+    }, this);
+    return {type: 'capacity-scheduler', tag: 'version1', properties: csProperties};
+  },
+
+  createMapredQueue: function () {
+    var configs = this.get('configs').filterProperty('filename', 'mapred-queue-acls.xml');
+    var mqProperties = {};
+    configs.forEach(function (_configProperty) {
+     mqProperties[_configProperty.name] = _configProperty.value;
+      console.log("STEP*: name of the property is: " + _configProperty.name);
+      console.log("STEP8: value of the property is: " + _configProperty.value);
+    }, this);
+    return {type: 'mapred-queue-acls', tag: 'version1', properties: mqProperties};
+  },
+
   createMrSitePerSlaveGroup: function (serviceName) {
     var mrSite = this.createMrSiteObj();
     var component = this.get('slaveComponentConfig.components').findProperty('serviceName', serviceName);
@@ -1460,7 +1485,7 @@ App.WizardStep8Controller = Em.Controlle
       case 'HDFS':
         return {config: {'global': 'version1', 'core-site': 'version1', 'hdfs-site': 'version1'}};
       case 'MAPREDUCE':
-        return {config: {'global': 'version1', 'core-site': 'version1', 'mapred-site': 'version1'}};
+        return {config: {'global': 'version1', 'core-site': 'version1', 'mapred-site': 'version1', 'capacity-scheduler': 'version1', 'mapred-queue-acls': 'version1'}};
       case 'HBASE':
         return {config: {'global': 'version1', 'hbase-site': 'version1'}};
       case 'OOZIE':
@@ -1475,7 +1500,6 @@ App.WizardStep8Controller = Em.Controlle
   },
 
 
-
   ajaxQueueFinished: function () {
     //do something
   },

Added: incubator/ambari/trunk/ambari-web/app/data/capacity-scheduler_default.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/capacity-scheduler_default.js?rev=1450542&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/capacity-scheduler_default.js (added)
+++ incubator/ambari/trunk/ambari-web/app/data/capacity-scheduler_default.js Wed Feb 27 00:03:05 2013
@@ -0,0 +1,147 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+module.exports = [
+  {
+    name: 'mapred.capacity-scheduler.maximum-system-jobs',
+    value: 3000,
+    description: 'Maximum number of jobs in the system which can be initialized, concurrently, by the CapacityScheduler.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.queue.default.capacity',
+    value: 100,
+    description: 'Percentage of the number of slots in the cluster that are to be available for jobs in this queue.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.queue.default.maximum-capacity',
+    value: -1,
+    description: 'maximum-capacity defines a limit beyond which a queue cannot use the capacity of the cluster.' +
+      'This provides a means to limit how much excess capacity a queue can use. By default, there is no limit.' +
+      'The maximum-capacity of a queue can only be greater than or equal to its minimum capacity.' +
+      'Default value of -1 implies a queue can use complete capacity of the cluster.' +
+      '\n' +
+      'This property could be to curtail certain jobs which are long running in nature from occupying more than a' +
+      'certain percentage of the cluster, which in the absence of pre-emption, could lead to capacity guarantees of ' +
+      'other queues being affected.' +
+      '\n' +
+      'One important thing to note is that maximum-capacity is a percentage , so based on the cluster\'s capacity' +
+      'the max capacity would change. So if large no of nodes or racks get added to the cluster , max Capacity in' +
+      'absolute terms would increase accordingly.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.queue.default.supports-priority',
+    value: false,
+    description: 'If true, priorities of jobs will be taken into account in scheduling decisions.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.queue.default.minimum-user-limit-percent',
+    value: 100,
+    description: 'Each queue enforces a limit on the percentage of resources' +
+      'allocated to a user at any given time, if there is competition for them.' +
+      'This user limit can vary between a minimum and maximum value. The former' +
+      'depends on the number of users who have submitted jobs, and the latter is' +
+      'set to this property value.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.queue.default.user-limit-factor',
+    value: 1,
+    description: 'The multiple of the queue capacity which can be configured to' +
+      'allow a single user to acquire more slots.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.queue.default.maximum-initialized-active-tasks',
+    value: 200000,
+    description: 'The maximum number of tasks, across all jobs in the queue,' +
+      'which can be initialized concurrently. Once the queue\'s jobs exceed this' +
+      'limit they will be queued on disk. '
+  },
+  {
+    name: 'mapred.capacity-scheduler.queue.default.maximum-initialized-active-tasks-per-user',
+    value: 100000,
+    description: 'The maximum number of tasks per-user, across all the of the' +
+      'user\'s jobs in the queue, which can be initialized concurrently. Once the' +
+      'user\'s jobs exceed this limit they will be queued on disk.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.queue.default.init-accept-jobs-factor',
+    value: 10,
+    description: 'The multipe of (maximum-system-jobs * queue-capacity) used to' +
+      'determine the number of jobs which are accepted by the scheduler.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.default-supports-priority',
+    value: false,
+    description: 'If true, priorities of jobs will be taken into' +
+      'account in scheduling decisions by default in a job queue.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.default-minimum-user-limit-percent',
+    value: 100,
+    description: 'The percentage of the resources limited to a particular user' +
+      'for the job queue at any given point of time by default.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.default-user-limit-factor',
+    value: 1,
+    description: 'The default multiple of queue-capacity which is used to' +
+      'determine the amount of slots a single user can consume concurrently.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.default-user-limit-factor',
+    value: 1,
+    description: 'The default multiple of queue-capacity which is used to' +
+      'determine the amount of slots a single user can consume concurrently.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.default-maximum-active-tasks-per-queue',
+    value: 200000,
+    description: 'The default maximum number of tasks, across all jobs in the' +
+      'queue, which can be initialized concurrently. Once the queue\'s jobs exceed' +
+      'this limit they will be queued on disk.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.default-maximum-active-tasks-per-user',
+    value: 100000,
+    description: 'The default maximum number of tasks per-user, across all the of' +
+      'the user\'s jobs in the queue, which can be initialized concurrently. Once' +
+      'the user\'s jobs exceed this limit they will be queued on disk.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.default-init-accept-jobs-factor',
+    value: 10,
+    description: 'The default multipe of (maximum-system-jobs * queue-capacity)' +
+      'used to determine the number of jobs which are accepted by the scheduler.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.init-poll-interval',
+    value: 5000,
+    description: 'The amount of time in milliseconds which is used to poll' +
+      'the job queues for jobs to initialize.'
+  },
+  {
+    name: 'mapred.capacity-scheduler.init-worker-threads',
+    value: 5,
+    description: 'Number of worker threads which would be used by' +
+      'Initialization poller to initialize jobs in a set of queue.' +
+      'If number mentioned in property is equal to number of job queues' +
+      'then a single thread would initialize jobs in a queue. If lesser' +
+      'then a thread would get a set of queues assigned. If the number' +
+      'is greater then number of threads would be equal to number of' +
+      'job queues.'
+  }
+];
+

Modified: incubator/ambari/trunk/ambari-web/app/data/config_properties.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/config_properties.js?rev=1450542&r1=1450541&r2=1450542&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/config_properties.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/config_properties.js Wed Feb 27 00:03:05 2013
@@ -1296,7 +1296,7 @@ module.exports =
       "displayName": "MapReduce Capacity Scheduler",
       "description": "The scheduler to use for scheduling of MapReduce jobs",
       "defaultValue": "org.apache.hadoop.mapred.CapacityTaskScheduler",
-      //"displayType": "directory",
+      "displayType": "advanced",
       "isVisible": true,
       "serviceName": "MAPREDUCE"
     },

Modified: incubator/ambari/trunk/ambari-web/app/data/custom_configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/custom_configs.js?rev=1450542&r1=1450541&r2=1450542&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/custom_configs.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/custom_configs.js Wed Feb 27 00:03:05 2013
@@ -25,7 +25,7 @@ module.exports =
       "displayName": "Custom Hadoop Configs",
       "value": "",
       "defaultValue": "",
-      "description": "Enter in \"key=value\" format to set core-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "description": "Enter in key=value format to set core-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
       "displayType": "custom",
       "isVisible": true,
       "isRequired": false,
@@ -39,7 +39,7 @@ module.exports =
       "displayName": "Custom HDFS Configs",
       "value": "",
       "defaultValue": "",
-      "description": "Enter in \"key=value\" format to set hdfs-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "description": "Enter in key=value format to set hdfs-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
       "displayType": "custom",
       "isVisible": true,
       "isRequired": false,
@@ -52,7 +52,7 @@ module.exports =
       "displayName": "Custom MapReduce Configs",
       "value": "",
       "defaultValue": "",
-      "description": "Enter in \"key=value\" format to set mapred-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "description": "Enter in key=value format to set mapred-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
       "displayType": "custom",
       "isVisible": true,
       "isRequired": false,
@@ -61,9 +61,35 @@ module.exports =
     },
     {
       "id": "conf-site",
+      "name": "capacity-scheduler",
+      "displayName": "Custom Capacity Scheduler Configs",
+      "value": "",
+      "defaultValue": require('data/capacity-scheduler_default'),
+      "description": "Enter in key=value format to set capacity-scheduler.xml  parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "displayType": "custom",
+      "isVisible": true,
+      "isRequired": false,
+      "serviceName": "MAPREDUCE",
+      "category": "Capacity Scheduler"
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred-queue-acls",
+      "displayName": "Custom MapReduce Queue Configs",
+      "value": "",
+      "defaultValue": require('data/mapred-queue-acl_default'),
+      "description": "Enter in key=value format to set mapred-queue-acls.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "displayType": "custom",
+      "isVisible": true,
+      "isRequired": false,
+      "serviceName": "MAPREDUCE",
+      "category": "Capacity Scheduler"
+    },
+    {
+      "id": "conf-site",
       "name": "hbase-site",
       "displayName": "Custom HBase Configs",
-      "description": "Enter in \"key=value\" format to set hbase-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "description": "Enter in key=value format to set hbase-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
       "defaultValue": "",
       "isRequired": false,
       "displayType": "custom",
@@ -75,7 +101,7 @@ module.exports =
       "id": "conf-site",
       "name": "hive-site",
       "displayName": "Custom Hive Configs",
-      "description": "Enter in \"key=value\" format to set hive-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "description": "Enter in key=value format to set hive-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
       "defaultValue": "",
       "isRequired": false,
       "displayType": "custom",
@@ -87,7 +113,7 @@ module.exports =
       "id": "conf-site",
       "name": "webhcat-site",
       "displayName": "Custom WebHCat Configs",
-      "description": "Enter in \"key=value\" format to set webhcat-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "description": "Enter in key=value format to set webhcat-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
       "defaultValue": "",
       "isRequired": false,
       "displayType": "custom",
@@ -99,7 +125,7 @@ module.exports =
       "id": "conf-site",
       "name": "oozie-site",
       "displayName": "Custom Oozie Configs",
-      "description": "Enter in \"key=value\" format to set oozie-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
+      "description": "Enter in key=value format to set oozie-site.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
       "defaultValue": "",
       "isRequired": false,
       "displayType": "custom",

Added: incubator/ambari/trunk/ambari-web/app/data/mapred-queue-acl_default.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/mapred-queue-acl_default.js?rev=1450542&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/mapred-queue-acl_default.js (added)
+++ incubator/ambari/trunk/ambari-web/app/data/mapred-queue-acl_default.js Wed Feb 27 00:03:05 2013
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+module.exports = [
+  {
+    name: 'mapred.queue.default.acl-submit-job',
+    value: ' ',
+    description: 'Comma separated list of user and group names that are allowed' +
+      'to submit jobs to the \'default\' queue. The user list and the group list' +
+      'are separated by a blank. For e.g. user1,user2 group1,group2.' +
+      'If set to the special value \'*\', it means all users are allowed to' +
+      'submit jobs. If set to \' \'(i.e. space), no user will be allowed to submit' +
+      'jobs.' +
+      '\n' +
+      'It is only used if authorization is enabled in Map/Reduce by setting the' +
+      'configuration property mapred.acls.enabled to true.' +
+      '\n' +
+      'Irrespective of this ACL configuration, the user who started the cluster and' +
+      'cluster administrators configured via' +
+      'mapreduce.cluster.administrators can submit jobs.'
+  },
+  {
+    name: 'mapred.queue.default.acl-administer-jobs',
+    value: ' ',
+    description: 'Comma separated list of user and group names that are allowed' +
+      'to view job details, kill jobs or modify job\'s priority for all the jobs' +
+      'in the \'default\' queue.'
+  }
+];
+

Modified: incubator/ambari/trunk/ambari-web/app/data/service_configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/service_configs.js?rev=1450542&r1=1450541&r2=1450542&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/service_configs.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/service_configs.js Wed Feb 27 00:03:05 2013
@@ -44,6 +44,7 @@ module.exports = [
       App.ServiceConfigCategory.create({ name: 'JobTracker'}),
       App.ServiceConfigCategory.create({ name: 'TaskTracker'}),
       App.ServiceConfigCategory.create({ name: 'General'}),
+      App.ServiceConfigCategory.create({ name: 'Capacity Scheduler'}),
       App.ServiceConfigCategory.create({ name: 'Advanced'})
     ],
     configs: configProperties.filterProperty('serviceName', 'MAPREDUCE')