You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/04/06 03:55:47 UTC

svn commit: r1465166 [9/15] - in /incubator/ambari/trunk: ./ ambari-web/app/ ambari-web/app/assets/data/background_operations/ ambari-web/app/assets/data/clusters/ ambari-web/app/assets/data/configurations/ ambari-web/app/assets/data/dashboard/ ambari-...

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js?rev=1465166&r1=1465165&r2=1465166&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step5_controller.js Sat Apr  6 01:55:42 2013
@@ -32,6 +32,10 @@ App.WizardStep5Controller = Em.Controlle
     return this.get('content.controllerName') == 'reassignMasterController';
   }.property(),
 
+  isReassignHive: function () {
+    return this.get('servicesMasters').objectAt(0) && this.get('servicesMasters').objectAt(0).component_name == 'HIVE_SERVER' && this.get('isReassignWizard');
+  }.property('isReassignWizard', 'servicesMasters'),
+
   hosts:[],
 
   servicesMasters:[],
@@ -66,13 +70,13 @@ App.WizardStep5Controller = Em.Controlle
   updateComponent: function(componentName){
     var component = this.last(componentName);
     if (component) {
-      if (this.get("selectedServicesMasters").filterProperty("component_name", componentName).length < this.get("hosts.length")) {
+      if (this.get("selectedServicesMasters").filterProperty("component_name", componentName).length < this.get("hosts.length") && !this.get('isReassignWizard')) {
         component.set('showAddControl', true);
       } else {
         component.set('showRemoveControl', false);
       }
-      if(componentName == 'ZOOKEEPER_SERVER'){
-        this.rebalanceZookeeperHosts();
+      if(componentName == 'ZOOKEEPER_SERVER' || componentName == 'HBASE_MASTER'){
+        this.rebalanceComponentHosts(componentName);
       }
     }
   },
@@ -161,7 +165,7 @@ App.WizardStep5Controller = Em.Controlle
           componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.HostComponent.find().someProperty('componentName', _componentInfo.component_name);
           componentObj.serviceId = services[index];
           componentObj.availableHosts = [];
-          componentObj.isHiveCoHost = ['HIVE_METASTORE', 'WEBHCAT_SERVER'].contains(_componentInfo.component_name);
+          componentObj.isHiveCoHost = ['HIVE_METASTORE', 'WEBHCAT_SERVER'].contains(_componentInfo.component_name) && !this.get('isReassignWizard');
           resultComponents.push(componentObj);
         }
       }, this);
@@ -175,8 +179,11 @@ App.WizardStep5Controller = Em.Controlle
    * @param masterComponents
    */
   renderComponents:function (masterComponents) {
-    var countZookeeper = masterComponents.filterProperty('display_name', 'ZooKeeper').length;
-    var countHbaseMaster = masterComponents.filterProperty('component_name', 'HBASE_MASTER').length;
+    var services = this.get('content.services')
+      .filterProperty('isInstalled', true).mapProperty('serviceName'); //list of shown services
+
+    var showRemoveControlZk = !services.contains('ZOOKEEPER') && masterComponents.filterProperty('display_name', 'ZooKeeper').length > 1;
+    var showRemoveControlHb = !services.contains('HBASE') && masterComponents.filterProperty('component_name', 'HBASE_MASTER').length > 1;
     var zid = 1;
     var hid = 1;
     var result = [];
@@ -188,10 +195,10 @@ App.WizardStep5Controller = Em.Controlle
 
       if (item.display_name === "ZooKeeper") {
         componentObj.set('zId', zid++);
-        componentObj.set("showRemoveControl", countZookeeper > 1);
+        componentObj.set("showRemoveControl", showRemoveControlZk);
       } else if(item.component_name === "HBASE_MASTER"){
         componentObj.set('zId', hid++);
-        componentObj.set("showRemoveControl", countHbaseMaster > 1);
+        componentObj.set("showRemoveControl", showRemoveControlHb);
       }
       componentObj.set("availableHosts", this.get("hosts"));
       result.push(componentObj);
@@ -199,15 +206,16 @@ App.WizardStep5Controller = Em.Controlle
 
     this.set("selectedServicesMasters", result);
     if (this.get('isReassignWizard')) {
-      var component = result.findProperty('component_name', this.get('content.reassign.component_name')).set('isInstalled', false);
-      this.set('servicesMasters', [component]);
+      var components = result.filterProperty('component_name', this.get('content.reassign.component_name'));
+      components.setEach('isInstalled', false);
+      this.set('servicesMasters', components);
     } else {
       this.set('servicesMasters', result);
     }
   },
 
   hasHiveServer: function () {
-    return !!this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_SERVER');
+    return !!this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_SERVER') && !this.get('isReassignWizard');
   }.property('selectedServicesMasters'),
 
   updateHiveCoHosts: function () {
@@ -215,7 +223,9 @@ App.WizardStep5Controller = Em.Controlle
     var hiveMetastore = this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE');
     var webHCatServer = this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER');
     if (hiveServer && hiveMetastore && webHCatServer) {
-      this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE').set('selectedHost', hiveServer.get('selectedHost'));
+      if (!this.get('isReassignHive') && this.get('servicesMasters').objectAt(0) && !this.get('servicesMasters').objectAt(0).component_name == 'HIVE_METASTORE') {
+        this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE').set('selectedHost', hiveServer.get('selectedHost'))
+      }
       this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER').set('selectedHost', hiveServer.get('selectedHost'));
     }
   }.observes('selectedServicesMasters.@each.selectedHost'),
@@ -294,7 +304,7 @@ App.WizardStep5Controller = Em.Controlle
     }
   },
 
-  getOozieServer:function (noOfHosts) {
+  getHiveServer:function (noOfHosts) {
     var hosts = this.get('hosts');
     if (noOfHosts === 1) {
       return hosts[0];
@@ -305,22 +315,23 @@ App.WizardStep5Controller = Em.Controlle
     } else if (noOfHosts <= 30) {
       return hosts[2];
     } else {
-      return hosts[3];
+      return hosts[4];
     }
   },
 
-  getHiveServer:function (noOfHosts) {
+  getHueServer:function (noOfHosts) {
     var hosts = this.get('hosts');
-    if (noOfHosts === 1) {
-      return hosts[0];
-    } else if (noOfHosts < 3) {
-      return hosts[1];
-    } else if (noOfHosts <= 5) {
-      return hosts[1];
-    } else if (noOfHosts <= 30) {
-      return hosts[2];
+    var hostnames = [];
+    var inc = 0;
+    hosts.forEach(function (_hostname) {
+      hostnames[inc] = _hostname.host_name;
+      inc++;
+    });
+    var hostExcAmbari = hostnames.without(location.hostname);
+    if (noOfHosts > 1) {
+      return hostExcAmbari[0];
     } else {
-      return hosts[4];
+      return hostnames[0];
     }
   },
 
@@ -406,6 +417,8 @@ App.WizardStep5Controller = Em.Controlle
         return this.getGangliaServer(noOfHosts);
       case 'NAGIOS_SERVER':
         return this.getNagiosServer(noOfHosts);
+      case 'HUE_SERVER':
+        return this.getHueServer(noOfHosts);
     }
   },
 
@@ -456,11 +469,9 @@ App.WizardStep5Controller = Em.Controlle
    */
   assignHostToMaster:function (componentName, selectedHost, zId) {
     if (selectedHost && componentName) {
-      if ((componentName === "ZOOKEEPER_SERVER") && zId) {
-        this.get('selectedServicesMasters').filterProperty('component_name', componentName).findProperty("zId", zId).set("selectedHost", selectedHost);
-        this.rebalanceZookeeperHosts();
-      } else if(zId){ //Hbase
+      if (zId) {
         this.get('selectedServicesMasters').filterProperty('component_name', componentName).findProperty("zId", zId).set("selectedHost", selectedHost);
+        this.rebalanceComponentHosts(componentName);
       } else {
         this.get('selectedServicesMasters').findProperty("component_name", componentName).set("selectedHost", selectedHost);
       }
@@ -537,8 +548,8 @@ App.WizardStep5Controller = Em.Controlle
 
       this.get("selectedServicesMasters").insertAt(this.get("selectedServicesMasters").indexOf(lastZoo) + 1, newZookeeper);
 
-      if(componentName == 'ZOOKEEPER_SERVER'){
-        this.rebalanceZookeeperHosts();
+      if(componentName == 'ZOOKEEPER_SERVER' || componentName == 'HBASE_MASTER'){
+        this.rebalanceComponentHosts(componentName);
       }
 
       return true;
@@ -571,8 +582,8 @@ App.WizardStep5Controller = Em.Controlle
       if (currentZooKeepers.get("length") === 1) {
         currentZooKeepers.set("lastObject.showRemoveControl", false);
       }
-      if(componentName == 'ZOOKEEPER_SERVER'){
-        this.rebalanceZookeeperHosts();
+      if(componentName == 'ZOOKEEPER_SERVER' || componentName == 'HBASE_MASTER'){
+        this.rebalanceComponentHosts(componentName);
       }
 
       return true;
@@ -582,23 +593,22 @@ App.WizardStep5Controller = Em.Controlle
 
   },
 
-  rebalanceZookeeperHosts:function () {
-    //for a zookeeper update the available hosts for the other zookeepers
-
-    var currentZooKeepers = this.get("selectedServicesMasters").filterProperty("display_name", "ZooKeeper"),
-      zooHosts = currentZooKeepers.mapProperty("selectedHost"),
-      availableZooHosts = [],
+  rebalanceComponentHosts:function (componentName) {
+    //for a zookeeper and hbase update the available hosts for the other zookeepers and hbases
+    var currentComponents = this.get("selectedServicesMasters").filterProperty("component_name", componentName),
+      componentHosts = currentComponents.mapProperty("selectedHost"),
+      availableComponentHosts = [],
       preparedAvailableHosts = null;
 
     //get all hosts available for zookeepers
     this.get("hosts").forEach(function (item) {
-      if (!zooHosts.contains(item.get("host_name"))) {
-        availableZooHosts.pushObject(item);
+      if (!componentHosts.contains(item.get("host_name"))) {
+        availableComponentHosts.pushObject(item);
       }
     }, this);
 
-    currentZooKeepers.forEach(function (item) {
-      preparedAvailableHosts = availableZooHosts.slice(0);
+    currentComponents.forEach(function (item) {
+      preparedAvailableHosts = availableComponentHosts.slice(0);
       preparedAvailableHosts.pushObject(this.get("hosts").findProperty("host_name", item.get("selectedHost")))
       preparedAvailableHosts.sort(this.sortHostsByConfig, this);
       item.set("availableHosts", preparedAvailableHosts);

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js?rev=1465166&r1=1465165&r2=1465166&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step6_controller.js Sat Apr  6 01:55:42 2013
@@ -49,6 +49,10 @@ App.WizardStep6Controller = Em.Controlle
     return this.get('content.controllerName') === 'addHostController';
   }.property('content.controllerName'),
 
+  isInstallerWizard: function(){
+    return this.get('content.controllerName') === 'installerController';
+  }.property('content.controllerName'),
+
   clearError: function () {
     var self = this;
     var isError = false;
@@ -310,6 +314,7 @@ App.WizardStep6Controller = Em.Controlle
         host.isMaster = self.hasMasterComponents(host.hostName);
         var checkboxes = host.get('checkboxes');
         checkboxes.setEach('checked', !host.isMaster);
+        checkboxes.setEach('isInstalled', false);
         checkboxes.findProperty('title', headers.findProperty('name', 'CLIENT').get('label')).set('checked', false);
         // First not Master should have Client (only first!)
         if (!client_is_set) {
@@ -320,6 +325,11 @@ App.WizardStep6Controller = Em.Controlle
           }
         }
       });
+
+      if(this.get('isInstallerWizard') && hostsObj.everyProperty('isMaster', true)){
+        var lastHost = hostsObj[hostsObj.length - 1];
+        lastHost.get('checkboxes').setEach('checked', true);
+      }
     }
     else {
       this.get('headers').forEach(function(header) {
@@ -329,7 +339,7 @@ App.WizardStep6Controller = Em.Controlle
             var node = hostsObj.findProperty('hostName', _node.hostName);
             if (node) {
               node.get('checkboxes').findProperty('title', header.get('label')).set('checked', true);
-              node.get('checkboxes').findProperty('title', header.get('label')).set('installed', _node.isInstalled);
+              node.get('checkboxes').findProperty('title', header.get('label')).set('isInstalled', _node.isInstalled);
             }
           });
         }

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=1465166&r1=1465165&r2=1465166&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 Sat Apr  6 01:55:42 2013
@@ -58,9 +58,6 @@ App.WizardStep7Controller = Em.Controlle
     return this.get('content.slaveGroupProperties');
   }.property('content.slaveGroupProperties', 'content.slaveComponentHosts'),
 
-  serviceConfigs: require('data/service_configs'),
-  configMapping: require('data/config_mapping'),
-  customConfigs: require('data/custom_configs'),
   customData: [],
 
   clearStep: function () {
@@ -73,193 +70,26 @@ App.WizardStep7Controller = Em.Controlle
   loadStep: function () {
     console.log("TRACE: Loading step7: Configure Services");
     this.clearStep();
-    var serviceConfigs = this.get('serviceConfigs');
-    var advancedConfig = this.get('content.advancedServiceConfig') || [];
-    this.loadAdvancedConfig(serviceConfigs, advancedConfig);
-    this.loadCustomConfig();
-    this.renderServiceConfigs(serviceConfigs);
-    var storedServices = this.get('content.serviceConfigProperties');
-    if (storedServices) {
-      var configs = new Ember.Set();
-
-      // for all services`
-      this.get('stepConfigs').forEach(function (_content) {
-        //for all components
-        
-        // Update existing values
-        var seenStoredConfigs = {};
-        _content.get('configs').forEach(function (_config) {
-          var componentVal = storedServices.findProperty('name', _config.get('name'));
-          //if we have config for specified component
-          if (componentVal) {
-            //set it
-            seenStoredConfigs[componentVal.name] = 'true';
-            _config.set('value', componentVal.value)
-            this.updateHostOverrides(_config, componentVal);
-          }
-        }, this);
-        
-        // Create new values
-        var currentServiceStoredConfigs = storedServices.filterProperty('service', _content.serviceName);
-        currentServiceStoredConfigs.forEach(function (storedConfig) {
-          if(!(storedConfig.name in seenStoredConfigs)){
-            console.log("loadStep7(): New property from local storage: ", storedConfig);
-            // Determine category
-            var configCategory = 'Advanced';
-            var serviceConfigMetaData = serviceConfigs.findProperty('serviceName', _content.serviceName);
-            var categoryMetaData = serviceConfigMetaData == null ? null : serviceConfigMetaData.configCategories.findProperty('siteFileName', storedConfig.filename);
-            if (categoryMetaData != null) {
-              configCategory = categoryMetaData.get('name');
-            }
-            // Configuration data
-            var configData = {
-                id: storedConfig.id,
-                name: storedConfig.name,
-                displayName: storedConfig.name,
-                serviceName: _content.serviceName,
-                value: storedConfig.value,
-                defaultValue: storedConfig.defaultValue,
-                displayType: "advanced",
-                filename: storedConfig.filename,
-                category: configCategory,
-                isUserProperty: true
-            }
-            var serviceConfigProperty = App.ServiceConfigProperty.create(configData);
-            serviceConfigProperty.serviceConfig = _content;
-            serviceConfigProperty.initialValue();
-            this.updateHostOverrides(serviceConfigProperty, storedConfig);
-            _content.configs.pushObject(serviceConfigProperty);
-            serviceConfigProperty.validate();
-          }
-        }, this);
-      }, this);
-    }
-  },
-  
-  updateHostOverrides: function (configProperty, storedConfigProperty) {
-    if(storedConfigProperty.overrides!=null && storedConfigProperty.overrides.length>0){
-      var overrides = configProperty.get('overrides');
-      if (!overrides) {
-        overrides = []; 
-        configProperty.set('overrides', overrides);
-      }
-      storedConfigProperty.overrides.forEach(function(overrideEntry){
-        // create new override with new value
-        var newSCP = App.ServiceConfigProperty.create(configProperty);
-        newSCP.set('value', overrideEntry.value);
-        newSCP.set('isOriginalSCP', false); // indicated this is overridden value,
-        newSCP.set('parentSCP', configProperty);
-        var hostsArray = Ember.A([]);
-        overrideEntry.hosts.forEach(function(host){
-          hostsArray.push(host);
-        });
-        newSCP.set('selectedHostOptions', hostsArray);
-        overrides.pushObject(newSCP);
-      });
-    }
-  },
-
-  /*
-   Loads the advanced configs fetched from the server metadata libarary
-   */
-
-  loadAdvancedConfig: function (serviceConfigs, advancedConfig) {
-    advancedConfig.forEach(function (_config) {
-      if (_config) {
-        var service = serviceConfigs.findProperty('serviceName', _config.serviceName);
-        if (service) {
-          if (this.get('configMapping').someProperty('name', _config.name)) {
-          } else if (!(service.configs.someProperty('name', _config.name))) {
-            _config.id = "site property";
-            _config.category = 'Advanced';
-            var serviceConfigMetaData = this.get('serviceConfigs').findProperty('serviceName', this.get('content.serviceName'));
-            var categoryMetaData = serviceConfigMetaData == null ? null : serviceConfigMetaData.configCategories.findProperty('siteFileName', serviceConfigObj.filename);
-            if (categoryMetaData != null) {
-              _config.category = categoryMetaData.get('name');
-            }
-            _config.displayName = _config.name;
-            _config.defaultValue = _config.value;
-            // make all advanced configs optional and populated by default
-            /*
-             * if (/\${.*}/.test(_config.value) || (service.serviceName !==
-             * 'OOZIE' && service.serviceName !== 'HBASE')) { _config.isRequired =
-             * false; _config.value = ''; } else if
-             * (/^\s+$/.test(_config.value)) { _config.isRequired = false; }
-             */
-            _config.isRequired = false;
-            _config.isVisible = true;
-            _config.displayType = 'advanced';
-            service.configs.pushObject(_config);
-          }
-        }
-      }
-    }, this);
-  },
-
-
-  /**
-   * Render a custom conf-site box for entering properties that will be written in *-site.xml files of the services
-   */
-  loadCustomConfig: function () {
-    var serviceConfigs = this.get('serviceConfigs');
-    this.get('customConfigs').forEach(function (_config) {
-      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;
+    //STEP 1: Load advanced configs
+    var advancedConfigs = this.get('content.advancedServiceConfig');
+    //STEP 2: Load on-site configs by service from local DB
+    var storedConfigs = this.get('content.serviceConfigProperties');
+    //STEP 3: Merge pre-defined configs with loaded on-site configs
+    var configs = App.config.mergePreDefinedWithStored(storedConfigs);
+    //STEP 4: Add advanced configs
+    App.config.addAdvancedConfigs(configs, advancedConfigs);
+    //STEP 5: Add custom configs
+    App.config.addCustomConfigs(configs);
+    //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty (configs -> serviceConfigs)
+    var serviceConfigs = App.config.renderConfigs(configs, this.get('allInstalledServiceNames'), this.get('selectedServiceNames'));
+    this.set('stepConfigs', serviceConfigs);
+    this.activateSpecialConfigs();
+    this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
   },
-
-  /**
-   * Render configs for active services
-   * @param serviceConfigs
+   /**
+   * make some configs visible depending on active services
    */
-  renderServiceConfigs: function (serviceConfigs) {
-    serviceConfigs.forEach(function (_serviceConfig) {
-
-      var serviceConfig = App.ServiceConfig.create({
-        filename: _serviceConfig.filename,
-        serviceName: _serviceConfig.serviceName,
-        displayName: _serviceConfig.displayName,
-        configCategories: _serviceConfig.configCategories,
-        showConfig: false,
-        configs: []
-      });
-
-      if (this.get('allInstalledServiceNames').contains(serviceConfig.serviceName) || serviceConfig.serviceName === 'MISC') {
-
-        this.loadComponentConfigs(_serviceConfig, serviceConfig);
-
-        console.log('pushing ' + serviceConfig.serviceName, serviceConfig);
-
-        if (this.get('selectedServiceNames').contains(serviceConfig.serviceName) || serviceConfig.serviceName === 'MISC') {
-          serviceConfig.showConfig = true;
-        }
-
-        this.get('stepConfigs').pushObject(serviceConfig);
-
-      } else {
-        console.log('skipping ' + serviceConfig.serviceName);
-      }
-    }, this);
-
+  activateSpecialConfigs: function () {
     var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
     var showProxyGroup = this.get('selectedServiceNames').contains('HIVE') ||
       this.get('selectedServiceNames').contains('HCATALOG') ||
@@ -271,27 +101,7 @@ App.WizardStep7Controller = Em.Controlle
     miscConfigs.findProperty('name', 'hcat_user').set('isVisible', this.get('selectedServiceNames').contains('HCATALOG'));
     miscConfigs.findProperty('name', 'webhcat_user').set('isVisible', this.get('selectedServiceNames').contains('WEBHCAT'));
     miscConfigs.findProperty('name', 'oozie_user').set('isVisible', this.get('selectedServiceNames').contains('OOZIE'));
-    miscConfigs.findProperty('name', 'pig_user').set('isVisible', this.get('selectedServiceNames').contains('PIG'));
-    miscConfigs.findProperty('name', 'sqoop_user').set('isVisible', this.get('selectedServiceNames').contains('SQOOP'));
     miscConfigs.findProperty('name', 'zk_user').set('isVisible', this.get('selectedServiceNames').contains('ZOOKEEPER'));
-    miscConfigs.findProperty('name', 'rrdcached_base_dir').set('isVisible', this.get('selectedServiceNames').contains('GANGLIA'));
-
-    this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
-  },
-
-  /**
-   * Load child components to service config object
-   * @param _componentConfig
-   * @param componentConfig
-   */
-  loadComponentConfigs: function (_componentConfig, componentConfig) {
-    _componentConfig.configs.forEach(function (_serviceConfigProperty) {
-      var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
-      serviceConfigProperty.serviceConfig = componentConfig;
-      serviceConfigProperty.initialValue();
-      componentConfig.configs.pushObject(serviceConfigProperty);
-      serviceConfigProperty.validate();
-    }, this);
   },
 
   /**

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=1465166&r1=1465165&r2=1465166&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 Sat Apr  6 01:55:42 2013
@@ -27,11 +27,32 @@ App.WizardStep8Controller = Em.Controlle
   configs: [],
   globals: [],
   ajaxQueue: [],
-  configMapping: require('data/config_mapping'),
+  configMapping: require('data/config_mapping').all(),
   slaveComponentConfig: null,
   isSubmitDisabled: false,
   hasErrorOccurred: false,
   servicesInstalled: false,
+  /**
+   * During page save time, we set the host overrides to the server.
+   * The new host -> site:tag map is stored below. This will be 
+   * useful during save, to update the host's host components. Also,
+   * it will be useful in deletion of overrides.
+   * 
+   * Example:
+   * {
+   *  'hostname1': {
+   *    'global': {
+   *      'tagName': 'tag3187261938_hostname1',
+   *      'map': {
+   *        'hadoop_heapsize': '2048m'
+   *      }
+   *    }
+   *  }
+   * }
+   * 
+   * @see loadedHostToOverrideSiteToTagMap
+   */
+  savedHostToOverrideSiteToTagMap: {},
 
   selectedServices: function () {
     return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
@@ -50,8 +71,6 @@ App.WizardStep8Controller = Em.Controlle
     this.clearStep();
     this.loadGlobals();
     this.loadConfigs();
-    this.setCustomConfigs();
-    //this.loadSlaveConfiguration();
     this.loadClusterInfo();
     this.loadServices();
     this.set('isSubmitDisabled', false);
@@ -60,14 +79,15 @@ App.WizardStep8Controller = Em.Controlle
   loadGlobals: function () {
     var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');
     if (globals.someProperty('name', 'hive_database')) {
-      //TODO: Hive host depends on the type of db selected. Change puppet variable name if postgres is not the default db
       var hiveDb = globals.findProperty('name', 'hive_database');
-      var hiveDbType = {name: 'hive_database_type'};
+      var hiveDbType = {name: 'hive_database_type', value: 'mysql'};
+      var hiveJdbcDriver = {name: 'hive_jdbc_driver'};
 
       if (hiveDb.value === 'New MySQL Database') {
         if (globals.someProperty('name', 'hive_ambari_host')) {
           globals.findProperty('name', 'hive_ambari_host').name = 'hive_hostname';
           hiveDbType.value = 'mysql';
+          hiveJdbcDriver.value = 'com.mysql.jdbc.Driver';
         }
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
@@ -76,6 +96,7 @@ App.WizardStep8Controller = Em.Controlle
       } else if (hiveDb.value === 'Existing MySQL Database'){
         globals.findProperty('name', 'hive_existing_mysql_host').name = 'hive_hostname';
         hiveDbType.value = 'mysql';
+        hiveJdbcDriver.value = 'com.mysql.jdbc.Driver';
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
@@ -83,12 +104,69 @@ App.WizardStep8Controller = Em.Controlle
       } else{ //existing oracle database
         globals.findProperty('name', 'hive_existing_oracle_host').name = 'hive_hostname';
         hiveDbType.value = 'oracle';
+        hiveJdbcDriver.value = 'oracle.jdbc.driver.OracleDriver';
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
       }
       globals.push(hiveDbType);
+      globals.push(hiveJdbcDriver);
+    }
+
+    if (globals.someProperty('name', 'oozie_database')) {
+      var oozieDb = globals.findProperty('name', 'oozie_database');
+      var oozieDbType = {name:'oozie_database_type'};
+      var oozieJdbcDriver = {name: 'oozie_jdbc_driver'};
+      var oozieJPAServcieURL = {name: 'oozie_JPAService_url'};
+
+      if (oozieDb.value === 'Current Derby Database'){
+        oozieDbType.value = 'derby';
+        oozieJdbcDriver.value = 'org.apache.derby.jdbc.EmbeddedDriver';
+        oozieJPAServcieURL.value = '${oozie.data.dir}/${oozie.db.schema.name}-db;create=true';  ///////
+
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+      }else if (oozieDb.value === 'New MySQL Database') {
+        if (globals.someProperty('name', 'oozie_ambari_host')) {
+          globals.findProperty('name', 'oozie_ambari_host').name = 'oozie_hostname';
+          oozieDbType.value = 'mysql';
+          oozieJdbcDriver.value = 'com.mysql.jdbc.Driver';
+          oozieJPAServcieURL.value = '//'+ globals.findProperty('name','oozie_hostname').value +'/' + globals.findProperty('name','oozie_database_name').value +'?createDatabaseIfNotExist=true';
+        }
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
+      } else if (oozieDb.value === 'Existing MySQL Database'){
+        globals.findProperty('name', 'oozie_existing_mysql_host').name = 'oozie_hostname';
+        oozieDbType.value = 'mysql';
+        oozieJdbcDriver.value = 'com.mysql.jdbc.Driver';
+        oozieJPAServcieURL.value = '//'+ globals.findProperty('name','oozie_hostname').value +'/' + globals.findProperty('name','oozie_database_name').value +'?createDatabaseIfNotExist=true';
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
+      } else{ //existing oracle database
+        globals.findProperty('name', 'oozie_existing_oracle_host').name = 'oozie_hostname';
+        oozieDbType.value = 'oracle';
+        oozieJdbcDriver.value = 'oracle.jdbc.driver.OracleDriver';
+        oozieJPAServcieURL.value = '//'+ globals.findProperty('name','oozie_hostname').value +'/'+ globals.findProperty('name','oozie_database_name').value +'?createDatabaseIfNotExist=true';
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
+      }
+      globals.push(oozieDbType);
+      globals.push(oozieJdbcDriver);
+      globals.push(oozieJPAServcieURL);
     }
 
     this.set('globals', globals);
@@ -97,7 +175,8 @@ App.WizardStep8Controller = Em.Controlle
   loadConfigs: function () {
     var storedConfigs = this.get('content.serviceConfigProperties').filterProperty('id', 'site property').filterProperty('value');
     var uiConfigs = this.loadUiSideConfigs();
-    this.set('configs', storedConfigs.concat(uiConfigs));
+    var customConfigs = this.loadCustomConfigs();
+    this.set('configs', storedConfigs.concat(uiConfigs, customConfigs));
   },
 
   loadUiSideConfigs: function () {
@@ -242,106 +321,20 @@ App.WizardStep8Controller = Em.Controlle
 
 
   /**
-   * override site properties with the entered key-value pair in *-site.xml
+   * load custom configs
    */
-  setCustomConfigs: function () {
-    var site = this.get('content.serviceConfigProperties').filterProperty('id', 'conf-site');
-    site.forEach(function (_site) {
-      var keyValue = _site.value.split(/\n+/);
-      if (keyValue) {
-        keyValue.forEach(function (_keyValue) {
-          _keyValue = _keyValue.trim();
-          console.log("The value of the keyValue is: " + _keyValue);
-          // split on the first = encountered (the value may contain ='s)
-          var matches = _keyValue.match(/^([^=]+)=(.*)$/);
-          if (matches) {
-            var key = matches[1];
-            var value = matches[2];
-            if (key) {
-              this.setSiteProperty(key, value, _site.name + '.xml');
-            }
-          }
-        }, this);
-      }
+  loadCustomConfigs: function () {
+    var configs = this.get('content.serviceConfigProperties').filterProperty('id', 'conf-site');
+    var customConfigs = [];
+    configs.forEach(function (_config) {
+      customConfigs.pushObject({
+        "id": "site property",
+        "name": _config.name,
+        "value": _config.value,
+        "filename": _config.filename
+      });
     }, this);
-  },
-
-  /**
-   * Set property of the site variable
-   */
-  setSiteProperty: function (key, value, filename) {
-    this.get('configs').pushObject({
-      "id": "site property",
-      "name": key,
-      "value": value,
-      "filename": filename
-    });
-  },
-
-  loadSlaveConfiguration: function () {
-
-    var slaveComponentConfig = this.convertSlaveConfig(this.get('content.slaveGroupProperties'));
-    this.set("slaveComponentConfig", slaveComponentConfig);
-  },
-
-  convertSlaveConfig: function (slaveContent) {
-    var dest = {
-      "version": "1.0",
-      "components": [
-      ],
-      "slaveHostComponents": []
-    };
-
-    slaveContent.forEach(function (_slaveContent) {
-      var newComponent = {};
-      newComponent.componentName = _slaveContent.componentName;
-      newComponent.serviceName = this.getServiceInfo(newComponent.componentName).name;
-      newComponent.groups = [];
-      var index = 2;
-      if (_slaveContent.groups) {
-        _slaveContent.groups.forEach(function (_group) {
-          var newGroup = {};
-          newGroup.groupName = _group.name;
-          newGroup.configVersion = {config: {'global': 'version1', 'core-site': 'version1'}}; // TODO : every time a new version should be generated
-          if (this.getServiceInfo(_slaveContent.componentName)) {
-            newGroup.configVersion.config[this.getServiceInfo(_slaveContent.componentName).domain] = 'version' + index;
-            newGroup.configVersion.config[this.getServiceInfo(_slaveContent.componentName).siteName] = 'version' + index;
-          }
-          newGroup.siteVersion = 'version' + index;
-          newGroup.hostNames = _slaveContent.hosts.filterProperty("group", newGroup.groupName).mapProperty('hostName');
-          newGroup.properties = _group.properties;
-          if (!Ember.empty(newGroup.hostNames)) {
-            newComponent.groups.push(newGroup);
-          }
-          index++;
-        }, this);
-      }
-      dest.components.push(newComponent);
-    }, this);
-    var hostsInfo = this.get('content.hosts');
-
-    for (var index in hostsInfo) {
-      var hostIndex = 2;
-      var slaveHost = {name: null, configVersion: null, slaveComponents: []};
-      dest.components.forEach(function (_component) {
-        _component.groups.forEach(function (_group) {
-          if (_group.hostNames.contains(hostsInfo[index].name)) {
-            var slaveComponent = {};
-            slaveHost.name = hostsInfo[index].name;
-            slaveComponent.componentName = _component.componentName;
-            slaveComponent.groupName = _group.groupName;
-            slaveComponent.properties = _group.properties;
-            slaveHost.slaveComponents.pushObject(slaveComponent);
-          }
-        }, this);
-      }, this);
-      hostIndex++;
-      if (!Ember.none(slaveHost.name)) {
-        dest.slaveHostComponents.pushObject(slaveHost);
-      }
-
-    }
-    return dest;
+    return customConfigs;
   },
 
   getServiceInfo: function (componentName) {
@@ -462,6 +455,9 @@ App.WizardStep8Controller = Em.Controlle
           case 'GANGLIA':
             this.loadGanglia(serviceObj);
             break;
+          case 'HUE':
+            this.loadHue(serviceObj);
+            break;
           /* case 'PIG':
            this.loadPig(serviceObj);
            break;
@@ -590,23 +586,14 @@ App.WizardStep8Controller = Em.Controlle
 
   loadHiveDbValue: function (dbComponent) {
     var hiveDb = App.db.getServiceConfigProperties().findProperty('name', 'hive_database');
-
     if (hiveDb.value === 'New MySQL Database') {
-
       dbComponent.set('component_value', 'MySQL (New Database)');
-
     } else if(hiveDb.value === 'Existing MySQL Database'){
-
       var db = App.db.getServiceConfigProperties().findProperty('name', 'hive_existing_mysql_database');
-
       dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
-
     } else { // existing oracle database
-
       var db = App.db.getServiceConfigProperties().findProperty('name', 'hive_existing_oracle_database');
-
       dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
-
     }
   },
 
@@ -679,6 +666,27 @@ App.WizardStep8Controller = Em.Controlle
   },
 
   /**
+   * Load all info about Hue services
+   * @param hueObj
+   */
+  loadHue: function (hueObj) {
+    hueObj.get('service_components').forEach(function (_component) {
+      switch (_component.get('display_name')) {
+        case 'Server':
+          this.loadHueServerValue(_component);
+          break;
+        default:
+      }
+    }, this);
+    this.get('services').pushObject(hueObj);
+  },
+
+  loadHueServerValue: function (hueServer) {
+    var hueServerName = this.get('content.masterComponentHosts').findProperty('display_name', 'Hue Server');
+    hueServer.set('component_value', hueServerName.hostName);
+  },
+
+  /**
    * Load all info about Oozie services
    * @param oozieObj
    */
@@ -690,7 +698,7 @@ App.WizardStep8Controller = Em.Controlle
           break;
         case 'Database':
           // TODO: uncomment when ready to integrate with Oozie Database other than Derby
-          // this.loadOozieDbValue(_component);
+          this.loadOozieDbValue(_component);
           break;
         default:
       }
@@ -705,12 +713,19 @@ App.WizardStep8Controller = Em.Controlle
 
   loadOozieDbValue: function (dbComponent) {
     var oozieDb = App.db.getServiceConfigProperties().findProperty('name', 'oozie_database');
-    if (oozieDb.value === 'New PostgreSQL Database') {
-      dbComponent.set('component_value', 'PostgreSQL (New Database)');
-    } else {
-      var db = App.db.getServiceConfigProperties().findProperty('name', 'oozie_existing_database');
+    if (oozieDb.value === 'Current Derby Database'){
+      var db = App.db.getServiceConfigProperties().findProperty('name', 'oozie_derby_database');
+      dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
+    } else if (oozieDb.value === 'New MySQL Database') {
+      dbComponent.set('component_value', 'MySQL (New Database)');
+    } else if(oozieDb.value === 'Existing MySQL Database'){
+      var db = App.db.getServiceConfigProperties().findProperty('name', 'oozie_existing_mysql_database');
+      dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
+    } else { // existing oracle database
+      var db = App.db.getServiceConfigProperties().findProperty('name', 'oozie_existing_oracle_database');
       dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
     }
+
   },
 
 
@@ -803,6 +818,14 @@ App.WizardStep8Controller = Em.Controlle
           localdb: App.db.data
         });
         break;
+      case 'addServiceController':
+        App.clusterStatus.setClusterStatus({
+          clusterName: this.get('clusterName'),
+          clusterState: 'ADD_SERVICES_DEPLOY_PREP_2',
+          wizardControllerName: this.get('content.controllerName'),
+          localdb: App.db.data
+        });
+        break;
       default:
         break;
     }
@@ -818,10 +841,10 @@ App.WizardStep8Controller = Em.Controlle
     this.createCluster();
     this.createSelectedServices();
     this.createConfigurations();
-    this.applyCreatedConfToServices();
     this.createComponents();
     this.registerHostsToCluster();
     this.createAllHostComponents();
+    this.createHostOverrideConfigurations();
 
     this.ajaxQueueFinished = function () {
       console.log('everything is loaded');
@@ -1197,41 +1220,47 @@ App.WizardStep8Controller = Em.Controlle
   createConfigurations: function () {
     var selectedServices = this.get('selectedServices');
     if (this.get('content.controllerName') == 'installerController') {
-      this.createConfigSiteForService(this.createGlobalSiteObj());
-      // this.createGlobalSitePerSlaveGroup();
-      this.createConfigSiteForService(this.createCoreSiteObj());
-      this.createConfigSiteForService(this.createHdfsSiteObj());
+      this.applyConfigurationToSite(this.createGlobalSiteObj());
+      this.applyConfigurationToSite(this.createCoreSiteObj());
+      this.applyConfigurationToSite(this.createHdfsSiteObj());
     }
     if (selectedServices.someProperty('serviceName', 'MAPREDUCE')) {
-      this.createConfigSiteForService(this.createMrSiteObj());
-      this.createConfigSiteForService(this.createCapacityScheduler());
-      this.createConfigSiteForService(this.createMapredQueueAcls());
+      this.applyConfigurationToSite(this.createMrSiteObj());
+      this.applyConfigurationToSite(this.createCapacityScheduler());
+      this.applyConfigurationToSite(this.createMapredQueueAcls());
     }
     if (selectedServices.someProperty('serviceName', 'HBASE')) {
-      this.createConfigSiteForService(this.createHbaseSiteObj());
+      this.applyConfigurationToSite(this.createHbaseSiteObj());
     }
     if (selectedServices.someProperty('serviceName', 'OOZIE')) {
-      this.createConfigSiteForService(this.createOozieSiteObj('OOZIE'));
+      this.applyConfigurationToSite(this.createOozieSiteObj('OOZIE'));
     }
     if (selectedServices.someProperty('serviceName', 'HIVE')) {
-      this.createConfigSiteForService(this.createHiveSiteObj('HIVE'));
+      this.applyConfigurationToSite(this.createHiveSiteObj('HIVE'));
     }
     if (selectedServices.someProperty('serviceName', 'WEBHCAT')) {
-      this.createConfigSiteForService(this.createWebHCatSiteObj('WEBHCAT'));
+      this.applyConfigurationToSite(this.createWebHCatSiteObj('WEBHCAT'));
+    }
+    if (selectedServices.someProperty('serviceName', 'HUE')) {
+      this.applyConfigurationToSite(this.createHueSiteObj('HUE'));
     }
   },
 
-  createConfigSiteForService: function (data) {
-    console.log("Inside createConfigSiteForService");
-
-    var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/configurations';
-
+  applyConfigurationToSite: function (data) {
+    console.log("Inside applyConfigurationToSite");
+    var clusterUrl = App.apiPrefix + '/clusters/' + this.get('clusterName');
+    var clusterData = {
+      Clusters: {
+        desired_configs: data
+      }
+    };
+    console.debug("applyConfigurationToSite(Step8): Applying to URL", clusterUrl, " Data:", clusterData);
     this.ajax({
-      type: 'POST',
-      url: url,
-      data: JSON.stringify(data),
+      type: 'PUT',
+      url: clusterUrl,
+      data: JSON.stringify(clusterData),
       beforeSend: function () {
-        console.log("BeforeSend: createConfigSiteForService for " + data.type);
+        console.log("BeforeSend: Updating cluster config for " + clusterData.type);
       }
     });
   },
@@ -1254,6 +1283,7 @@ App.WizardStep8Controller = Em.Controlle
       if (_globalSiteObj.name == 'java64_home') {
         globalSiteProperties['java64_home'] = this.get('content.installOptions.javaHome');
       }
+      this._recordHostOverrideFromObj(_globalSiteObj, 'global', 'version1', this);
     }, this);
     return {"type": "global", "tag": "version1", "properties": globalSiteProperties};
   },
@@ -1271,6 +1301,7 @@ App.WizardStep8Controller = Em.Controlle
     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'))) {
         coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
+        this._recordHostOverrideFromObj(_coreSiteObj, 'core-site', 'version1', this);
       }
       console.log("STEP*: name of the property is: " + _coreSiteObj.name);
       console.log("STEP8: value of the property is: " + _coreSiteObj.value);
@@ -1283,17 +1314,31 @@ App.WizardStep8Controller = Em.Controlle
     var hdfsProperties = {};
     hdfsSiteObj.forEach(function (_configProperty) {
       hdfsProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'hdfs-site', 'version1', this);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
     return {"type": "hdfs-site", "tag": "version1", "properties": hdfsProperties };
   },
 
+  createHueSiteObj: function () {
+    var hueSiteObj = this.get('configs').filterProperty('filename', 'hue-site.xml');
+    var hueProperties = {};
+    hueSiteObj.forEach(function (_configProperty) {
+      hueProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'hue-site', 'version1', this);
+      console.log("STEP*: name of the property is: " + _configProperty.name);
+      console.log("STEP8: value of the property is: " + _configProperty.value);
+    }, this);
+    return {"type": "hue-site", "tag": "version1", "properties": hueProperties };
+  },
+
   createMrSiteObj: function () {
     var configs = this.get('configs').filterProperty('filename', 'mapred-site.xml');
     var mrProperties = {};
     configs.forEach(function (_configProperty) {
       mrProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'mapred-site', 'version1', this);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
@@ -1305,6 +1350,7 @@ App.WizardStep8Controller = Em.Controlle
     var csProperties = {};
     configs.forEach(function (_configProperty) {
       csProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'capacity-scheduler', 'version1', this);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
@@ -1316,6 +1362,7 @@ App.WizardStep8Controller = Em.Controlle
     var mqProperties = {};
     configs.forEach(function (_configProperty) {
      mqProperties[_configProperty.name] = _configProperty.value;
+     this._recordHostOverrideFromObj(_configProperty, 'mapred-queue-acls', 'version1', this);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
@@ -1327,6 +1374,7 @@ App.WizardStep8Controller = Em.Controlle
     var hbaseProperties = {};
     configs.forEach(function (_configProperty) {
       hbaseProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'hbase-site', 'version1', this);
     }, this);
     return {type: 'hbase-site', tag: 'version1', properties: hbaseProperties};
   },
@@ -1336,7 +1384,9 @@ App.WizardStep8Controller = Em.Controlle
     var oozieProperties = {};
     configs.forEach(function (_configProperty) {
       oozieProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'oozie-site', 'version1', this);
     }, this);
+
     return {type: 'oozie-site', tag: 'version1', properties: oozieProperties};
   },
 
@@ -1345,7 +1395,9 @@ App.WizardStep8Controller = Em.Controlle
     var hiveProperties = {};
     configs.forEach(function (_configProperty) {
       hiveProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'hive-site', 'version1', this);
     }, this);
+
     return {type: 'hive-site', tag: 'version1', properties: hiveProperties};
   },
 
@@ -1354,33 +1406,11 @@ App.WizardStep8Controller = Em.Controlle
     var webHCatProperties = {};
     configs.forEach(function (_configProperty) {
       webHCatProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'webhcat-site', 'version1', this);
     }, this);
     return {type: 'webhcat-site', tag: 'version1', properties: webHCatProperties};
   },
 
-  applyCreatedConfToServices: function () {
-    var services = this.get('selectedServices').mapProperty('serviceName');
-    services.forEach(function (_service) {
-      var data = this.getConfigForService(_service);
-      this.applyCreatedConfToService(_service, 'PUT', data);
-    }, this);
-  },
-
-  applyCreatedConfToService: function (service, httpMethod, data) {
-    console.log("Inside applyCreatedConfToService");
-
-    var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/services/' + service;
-
-    this.ajax({
-      type: httpMethod,
-      url: url,
-      data: JSON.stringify(data),
-      beforeSend: function () {
-        console.log("BeforeSend: applyCreatedConfToService for " + service);
-      }
-    });
-  },
-
   getConfigForService: function (serviceName) {
     switch (serviceName) {
       case 'HDFS':
@@ -1395,6 +1425,8 @@ App.WizardStep8Controller = Em.Controlle
         return {config: {'global': 'version1', 'hive-site': 'version1'}};
       case 'WEBHCAT':
         return {config: {'global': 'version1', 'webhcat-site': 'version1'}};
+      case 'HUE':
+        return {config: {'global': 'version1', 'hue-site': 'version1'}};
       default:
         return {config: {'global': 'version1'}};
     }
@@ -1428,9 +1460,69 @@ App.WizardStep8Controller = Em.Controlle
   },
 
   /**
-   * We need to do a lot of ajax calls async in special order.
-   * To do this, generate array of ajax objects and then send requests step by step.
-   * All ajax objects are stored in <code>ajaxQueue</code>
+   * Records all the host overrides per site/tag
+   */
+  _recordHostOverrideFromObj: function(serviceConfigObj, siteName, tagName, self){
+    var overrides = serviceConfigObj.overrides;
+    if(overrides && overrides.length>0){
+      overrides.forEach(function(override){
+        override.hosts.forEach(function(host){
+          if(!(host in self.savedHostToOverrideSiteToTagMap)){
+            self.savedHostToOverrideSiteToTagMap[host] = {};
+          }
+          if(!(siteName in self.savedHostToOverrideSiteToTagMap[host])){
+            self.savedHostToOverrideSiteToTagMap[host][siteName] = {};
+            self.savedHostToOverrideSiteToTagMap[host][siteName].map = {};
+          }
+          var finalTag = tagName + '_' + host;
+          console.log("recordHostOverride(): Saving host override for host="+host+", site="+siteName+", tag="+finalTag+", (key,value)=("+serviceConfigObj.name+","+override.value+")");
+          self.savedHostToOverrideSiteToTagMap[host][siteName].tagName = finalTag;
+          self.savedHostToOverrideSiteToTagMap[host][siteName].map[serviceConfigObj.name] = override.value;
+        });
+      });
+    }
+  },
+
+  /**
+   * Creates host level overrides for service configuration.
+   * 
+   */
+  createHostOverrideConfigurations: function () {
+    var savedHostSiteArray = [];
+    for ( var host in this.savedHostToOverrideSiteToTagMap) {
+      for ( var siteName in this.savedHostToOverrideSiteToTagMap[host]) {
+        var tagName = this.savedHostToOverrideSiteToTagMap[host][siteName].tagName;
+        var map = this.savedHostToOverrideSiteToTagMap[host][siteName].map;
+        savedHostSiteArray.push(host + "///" + siteName);
+        var hostOverridenServerData = {
+          Hosts: {
+            desired_config: {
+              type: siteName,
+              tag: tagName,
+              properties: map
+            }
+          }
+        };
+        console.log("createHostOverrideConfigSites(): PUTting host-override config for host=" + host + ", site=" + siteName + ", tag=" + tagName + ". Data=", hostOverridenServerData);
+        var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/hosts/' + host;
+        this.ajax({
+          type: 'PUT',
+          url: url,
+          data: JSON.stringify(hostOverridenServerData),
+          dataType: 'text',
+          beforeSend: function () {
+            console.log("createHostOverrideConfigSites("+host+") override=", hostOverridenServerData);
+          }
+        });
+      }
+    }
+  },
+
+  /**
+   * We need to do a lot of ajax calls async in special order. To do this,
+   * generate array of ajax objects and then send requests step by step. All
+   * ajax objects are stored in <code>ajaxQueue</code>
+   * 
    * @param params
    */
 
@@ -1481,10 +1573,3 @@ App.WizardStep8Controller = Em.Controlle
   }
 
 });
-
-
-
-
-
-  
-  

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js?rev=1465166&r1=1465165&r2=1465166&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js Sat Apr  6 01:55:42 2013
@@ -61,6 +61,72 @@ App.WizardStep9Controller = Em.Controlle
     return 'info';
   }.property('hosts.@each.status', 'progress'),
 
+  categoryObject: Em.Object.extend({
+    hostsCount: function () {
+      var category = this;
+      var hosts = this.get('controller.hosts').filter(function(_host) {
+        if(category.get('hostStatus') == 'inProgress'){   // queued, pending, in_progress map to inProgress
+          return (_host.get('status') !== 'success' && _host.get('status') !== 'failed' && _host.get('status') !== 'warning');
+        }
+        return (_host.get('status') == category.get('hostStatus'));
+      }, this);
+      return hosts.get('length');
+    }.property('controller.hosts.@each.status'),
+    label: function () {
+      return "%@ (%@)".fmt(this.get('value'), this.get('hostsCount'));
+    }.property('value', 'hostsCount')
+  }),
+  getCategory: function(field, value){
+    return this.get('categories').find(function(item){
+      return item.get(field) == value;
+    });
+  },
+
+  categories: function () {
+    var self = this;
+    self.categoryObject.reopen({
+      controller: self,
+      isActive: function(){
+        return this.get('controller.category') == this;
+      }.property('controller.category'),
+      itemClass: function(){
+        return this.get('isActive') ? 'active' : '';
+      }.property('isActive')
+    });
+
+    var categories = [
+      self.categoryObject.create({value: Em.I18n.t('common.all'), hostStatus:'all', hostsCount: function () {
+        return this.get('controller.hosts.length');
+      }.property('controller.hosts.length') }),
+      self.categoryObject.create({value: Em.I18n.t('installer.step9.hosts.status.label.inProgress'), hostStatus: 'inProgress'}),
+      self.categoryObject.create({value: Em.I18n.t('installer.step9.hosts.status.label.warning'), hostStatus: 'warning'}),
+      self.categoryObject.create({value: Em.I18n.t('common.success'), hostStatus: 'success'}),
+      self.categoryObject.create({value: Em.I18n.t('common.fail'), hostStatus: 'failed', last: true })
+    ];
+
+    this.set('category', categories.get('firstObject'));
+    return categories;
+  }.property(),
+
+  category: false,
+  visibleHosts: function(){
+    var targetStatus = this.get('category.hostStatus');
+    var visibleHosts =  this.get('hosts').filter(function(_host) {
+      if (targetStatus == 'all') {
+        return true;
+      }
+      if (targetStatus == 'inProgress') {   // queued, pending, in_progress map to inProgress
+        return (_host.get('status') !== 'success' && _host.get('status') !== 'failed' && _host.get('status') !== 'warning');
+      }
+      return (_host.get('status') == targetStatus);
+    }, this);
+    return visibleHosts;
+  }.property('category', 'hosts.@each.status'),
+
+  selectCategory: function(event){
+    this.set('category', event.context);
+  },
+
   showRetry: function () {
     return this.get('content.cluster.status') == 'INSTALL FAILED';
   }.property('content.cluster.status'),
@@ -268,7 +334,7 @@ App.WizardStep9Controller = Em.Controlle
     var self = this;
     var clusterName = this.get('content.cluster.name');
     var url = App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo/state=INSTALLED';
-    var data = '{"ServiceInfo": {"state": "STARTED"}}';
+    var data = '{"RequestInfo": {"context": "'+Em.I18n.t("requestInfo.serviceStartCheck")+'"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}';
     var method = 'PUT';
 
     if (this.get('content.controllerName') === 'addHostController') {

Modified: incubator/ambari/trunk/ambari-web/app/data/config_mapping.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/config_mapping.js?rev=1465166&r1=1465165&r2=1465166&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/config_mapping.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/config_mapping.js Sat Apr  6 01:55:42 2013
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-module.exports = [
+var configs = [
   {
     "name": "fs.default.name",
     "templateName": ["namenode_host"],
@@ -57,42 +57,48 @@ module.exports = [
     "templateName": ["proxyuser_group"],
     "foreignKey": ["hive_user"],
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "templateName": ["hivemetastore_host"],
     "foreignKey": ["hive_user"],
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
     "templateName": ["proxyuser_group"],
     "foreignKey": ["oozie_user"],
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "templateName": ["oozieserver_host"],
     "foreignKey": ["oozie_user"],
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
     "templateName": ["proxyuser_group"],
     "foreignKey": ["webhcat_user"],
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "templateName": ["hivemetastore_host"],
     "foreignKey": ["webhcat_user"],
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   {
     "name": "dfs.name.dir",
@@ -310,36 +316,59 @@ module.exports = [
     "value": "http://<templateName[0]>:11000/oozie",
     "filename": "oozie-site.xml"
   },
-  /*
-   {
-   "name": "oozie.service.JPAService.jdbc.password",
-   "templateName": [],
-   "foreignKey": null,
-   "value": " ",
-   "filename": "oozie-site.xml"
-   },
-   {
-   "name": "oozie.db.schema.name",
-   "templateName": [],
-   "foreignKey": null,
-   "value": "oozie",
-   "filename": "oozie-site.xml"
-   },
-   {
-   "name": "oozie.service.JPAService.jdbc.url",
-   "templateName": [],
-   "foreignKey": null,
-   "value": "jdbc:derby:/var/data/oozie/oozie-db;create=true",
-   "filename": "oozie-site.xml"
-   },
-   {
-   "name": "oozie.action.ssh.http.command.post.options",
-   "templateName": [],
-   "foreignKey": null,
-   "value": " ",
-   "filename": "oozie-site.xml"
-   },
-   */
+  {
+    "name": "oozie.service.JPAService.jdbc.password",
+    "templateName": ["oozie_metastore_user_passwd"],
+    "foreignKey": null,
+    "value": "<templateName[0]>",
+    "filename": "oozie-site.xml"
+  },
+  {
+    "name": "oozie.service.JPAService.jdbc.username",
+    "templateName": ["oozie_metastore_user_name"],
+    "foreignKey": null,
+    "value": "<templateName[0]>",
+    "filename": "oozie-site.xml"
+  },
+  {
+    "name": "oozie.service.JPAService.jdbc.driver",
+    "templateName": ["oozie_jdbc_driver"],
+    "foreignKey": null,
+    "value": "<templateName[0]>",
+    "filename": "oozie-site.xml"
+  },
+
+  {
+    "name": "oozie.service.JPAService.jdbc.url",  ///////////////
+    "templateName": ["oozie_database_type", "oozie_JPAService_url"], // 4 type database //
+    "foreignKey": null,
+    "value": "jdbc:<templateName[0]>:<templateName[1]>",
+    "filename": "oozie-site.xml"
+  },
+
+//  {
+//    "name": "oozie.service.JPAService.jdbc.url",
+//    "templateName": ["oozie_database_type", "oozie_hostname", "oozie_database_name"],
+//    "foreignKey": null,
+//    "value": "jdbc:<templateName[0]>://<templateName[1]>/<templateName[2]>?createDatabaseIfNotExist=true",
+//    "filename": "oozie-site.xml"
+//  },
+  
+//  {
+//    "name": "oozie.db.schema.name",
+//    "templateName": ["oozie_metastore_user_name"],
+//    "foreignKey": null,
+//    "value": "<templateName[0]>",
+//    "filename": "oozie-site.xml"
+//  },
+
+//  {
+//    "name": "oozie.action.ssh.http.command.post.options",
+//    "templateName": [],
+//    "foreignKey": null,
+//    "value": " ",
+//    "filename": "oozie-site.xml"
+//  },
   {
     "name": "javax.jdo.option.ConnectionURL",
     "templateName": ["hive_database_type", "hive_hostname", "hive_database_name"],
@@ -362,6 +391,13 @@ module.exports = [
     "filename": "hive-site.xml"
   },
   {
+    "name": "javax.jdo.option.ConnectionDriverName",
+    "templateName": ["hive_jdbc_driver"],
+    "foreignKey": null,
+    "value": "<templateName[0]>",
+    "filename": "hive-site.xml"
+  },
+  {
     "name": "hive.metastore.uris",
     "templateName": ["hivemetastore_host"],
     "foreignKey": null,
@@ -822,4 +858,22 @@ module.exports = [
     "value": "<templateName[0]>",
     "filename": "hbase-site.xml"
   }
-];
\ No newline at end of file
+];
+
+/**
+ * Configs consists of 2 types: Computed values, which cannot be modified by user
+ * and overridable values, which user can modify. We provide interface how to get all of this
+ * configs separately
+ * @type {Object}
+ */
+module.exports = {
+  all : function(){
+    return configs.slice(0);
+  },
+  overridable: function(){
+    return configs.filterProperty("isOverridable", true);
+  },
+  computed: function(){
+    return configs.filterProperty("isOverridable", false);
+  }
+};

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=1465166&r1=1465165&r2=1465166&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/config_properties.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/config_properties.js Sat Apr  6 01:55:42 2013
@@ -831,32 +831,7 @@ module.exports =
       "serviceName": "HIVE",
       "category": "Hive Metastore"
     },
-    /* Comment out the other hive_database and uncomment this for Hive with Postgres support
-    {
-      "id": "puppet var",
-      "name": "hive_database",
-      "displayName": "Hive Database",
-      "value": "",
-      "defaultValue": "New PostgreSQL Database",
-      "options": [
-        {
-          displayName: 'New PostgreSQL Database',
-          foreignKeys: ['hive_ambari_database', 'hive_ambari_host']
-        },
-        {
-          displayName: 'Existing Database',
-          foreignKeys: ['hive_existing_database', 'hive_existing_host']
-        }
-      ],
-      "description": "PostgreSQL will be installed by Ambari. Any other database will have to be installed by the user.",
-      "displayType": "radio button",
-      "radioName": "hive-database",
-      "isVisible": true,
-      "domain": "global",
-      "serviceName": "HIVE",
-      "category": "Hive Metastore"
-    },
-    */
+
     {
       "id": "puppet var",
       "name": "hive_database",
@@ -903,40 +878,10 @@ module.exports =
       "serviceName": "HIVE",
       "category": "Hive Metastore"
     },
-    /* Uncomment for Hive with Postgres support
-    {
-      "id": "puppet var",
-      "name": "hive_existing_database",
-      "displayName": "Hive Database",
-      "value": "",
-      "defaultValue": "MySQL",
-      "description": "Select the database, if you already have existing one for Hive Metastore.",
-      "displayType": "string",
-      "isVisible": false,
-      "options": ['MySQL', 'PostgreSQL'],
-      "domain": "global",
-      "serviceName": "HIVE",
-      "category": "Hive Metastore"
-    },
-    {
-      "id": "puppet var",
-      "name": "hive_existing_database",
-      "displayName": "Hive Database",
-      "value": "",
-      "defaultValue": "MySQL",
-      "description": "Select the database, if you already have existing one for Hive Metastore.",
-      "displayType": "combobox",
-      "isVisible": false,
-      "options": ['MySQL', 'PostgreSQL'],
-      "domain": "global",
-      "serviceName": "HIVE",
-      "category": "Hive Metastore"
-    },
-    */
     {
       "id": "puppet var",
       "name": "hive_existing_mysql_host",
-      "displayName": "Database host",
+      "displayName": "Database Host",
       "description": "Specify the host on which the existing database is hosted",
       "defaultValue": "",
       "isReconfigurable": false,
@@ -966,7 +911,7 @@ module.exports =
     {
       "id": "puppet var",
       "name": "hive_existing_oracle_host",
-      "displayName": "Database host",
+      "displayName": "Database Host",
       "description": "Specify the host on which the existing database is hosted",
       "defaultValue": "",
       "isReconfigurable": false,
@@ -987,7 +932,7 @@ module.exports =
       "description": "MySQL will be installed by Ambari",
       "displayType": "masterHost",
       "isOverridable": false,
-      "isVisible": true,
+      "isVisible": false,
       "domain": "global",
       "serviceName": "HIVE",
       "category": "Hive Metastore"
@@ -997,12 +942,12 @@ module.exports =
       "name": "hive_ambari_host",
       "value": "",
       "defaultValue": "",
-      "displayName": "Database host",
+      "displayName": "Database Host",
       "description": "Host on which the database will be created by Ambari",
       "isReconfigurable": false,
       "displayType": "masterHost",
       "isOverridable": false,
-      "isVisible": true,
+      "isVisible": false,
       "domain": "global",
       "serviceName": "HIVE",
       "category": "Hive Metastore"
@@ -1010,7 +955,7 @@ module.exports =
     {
       "id": "puppet var",
       "name": "hive_database_name",
-      "displayName": "Database name",
+      "displayName": "Database Name",
       "description": "Database name used as the Hive Metastore",
       "defaultValue": "hive",
       "isReconfigurable": false,
@@ -1024,7 +969,7 @@ module.exports =
     {
       "id": "puppet var",
       "name": "hive_metastore_user_name",
-      "displayName": "Database user",
+      "displayName": "Database Username",
       "description": "Database user name to use to connect to the database",
       "defaultValue": "hive",
       "isReconfigurable": false,
@@ -1038,7 +983,7 @@ module.exports =
     {
       "id": "puppet var",
       "name": "hive_metastore_user_passwd",
-      "displayName": "Database password",
+      "displayName": "Database Password",
       "description": "Database password to use to connect to the PostgreSQL database",
       "defaultValue": "",
       "isReconfigurable": false,
@@ -1111,7 +1056,7 @@ module.exports =
       "isReconfigurable": false,
       "displayType": "directory",
       "isOverridable": false,
-      "isVisible": false,
+      "isVisible": true,
       "domain": "global",
       "serviceName": "HIVE",
       "category": "Advanced"
@@ -1727,6 +1672,130 @@ module.exports =
       "serviceName": "HDFS",
       "category": "Advanced"
     },
+    {
+      "id": "conf-site",
+      "name": "mapred.capacity-scheduler.maximum-system-jobs",
+      "displayName": "Max system jobs",
+      "displayType": "int",
+      "value": '3000',
+      "defaultValue": '3000',
+      "description": "Maximum number of jobs in the system which can be initialized, concurrently, by the " +
+        "CapacityScheduler. Individual queue limits on initialized jobs are directly proportional to their queue " +
+        "capacities.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "filename": "capacity-scheduler.xml"
+    },
+    /*{
+      "id": "conf-site",
+      "name": "mapred.cluster.map.memory.mb",
+      "displayName": "Map slot memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The size, in terms of virtual memory, of a single map slot in the Map-Reduce framework, used by " +
+        "the scheduler. A job can ask for multiple slots for a single map task via \"Map task memory\", upto the limit " +
+        "specified by \"Max map task memory\", if the scheduler supports the feature. The value of -1 indicates that " +
+        "this feature is turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.cluster.reduce.memory.mb",
+      "displayName": "Reduce slot memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The size, in terms of virtual memory, of a single reduce slot in the Map-Reduce framework, " +
+        "used by the scheduler. A job can ask for multiple slots for a single reduce task via \"Reduce task memory\", " +
+        "upto the limit specified by \"Max reduce task memory\", if the scheduler supports the feature.The value of " +
+        "-1 indicates that this feature is turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.cluster.max.map.memory.mb",
+      "displayName": "Max map task memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The maximum size, in terms of virtual memory, of a single map task launched by the Map-Reduce " +
+        "framework, used by the scheduler. A job can ask for multiple slots for a single map task via " +
+        "\"Map task memory\", upto the limit specified by \"Max map task memory\", if the scheduler supports the " +
+        "feature. The value of -1 indicates that this feature is turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.cluster.max.reduce.memory.mb",
+      "displayName": "Max reduce task memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The maximum size, in terms of virtual memory, of a single reduce task launched by the Map-Reduce " +
+        "framework, used by the scheduler. A job can ask for multiple slots for a single reduce task via \"Reduce task " +
+        "memory\", upto the limit specified by \"Max reduce task memory\", if the scheduler supports the feature. " +
+        "The value of -1 indicates that this feature is turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.job.map.memory.mb",
+      "displayName": "Map task memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The size, in terms of virtual memory, of a single map task for the job. A job can ask for " +
+        "multiple slots for a single map task, rounded up to the next multiple of \"Map slot memory\" and upto " +
+        "the limit specified by \"Max map task memory\", if the scheduler supports the feature. The value of -1 " +
+        "indicates that this feature is turned off iff \"Map slot memory\" is also turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.job.reduce.memory.mb",
+      "displayName": "Reduce task memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The size, in terms of virtual memory, of a single reduce task for the job. A job can ask for " +
+        "multiple slots for a single reduce task, rounded up to the next multiple of \"Reduce slot memory\" and upto " +
+        "the limit specified by \"Max reduce task memory\", if the scheduler supports the feature. The value of -1 " +
+        "indicates that this feature is turned off iff \"Task slot memory\" is also turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },*/
     /*
     {
       "id": "puppet var",
@@ -1956,20 +2025,6 @@ module.exports =
       "category": "General"
     },
     */
-    {
-      "id": "puppet var",
-      "name": "pig_user",
-      "displayName": "Pig User",
-      "description": "User to run Pig as",
-      "defaultValue": "pig",
-      "isReconfigurable": false,
-      "displayType": "user",
-      "isOverridable": false,
-      "isVisible": true,
-      "domain": "global",
-      "serviceName": "MISC",
-      "category": "Users and Groups"
-    },
     /*
     {
       "id": "puppet var",
@@ -2000,10 +2055,10 @@ module.exports =
     */
     {
       "id": "puppet var",
-      "name": "sqoop_user",
-      "displayName": "Sqoop User",
-      "description": "User to run Sqoop as",
-      "defaultValue": "sqoop",
+      "name": "zk_user",
+      "displayName": "ZooKeeper User",
+      "description": "User to run ZooKeeper as",
+      "defaultValue": "zookeeper",
       "isReconfigurable": false,
       "displayType": "user",
       "isOverridable": false,
@@ -2014,10 +2069,10 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "zk_user",
-      "displayName": "ZooKeeper User",
-      "description": "User to run ZooKeeper as",
-      "defaultValue": "zookeeper",
+      "name": "smokeuser",
+      "displayName": "Smoke Test User",
+      "description": "The user used to run service smoke tests",
+      "defaultValue": "ambari-qa",
       "isReconfigurable": false,
       "displayType": "user",
       "isOverridable": false,
@@ -2118,64 +2173,204 @@ module.exports =
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
-    /*
+    ////////
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_database",
+//      "displayName": "Oozie Database",
+//      "value": "",
+//      "defaultValue": "New PostgreSQL Database",
+//      "options": [
+//        {
+//          displayName: 'New PostgreSQL Database',
+//          foreignKeys: ['oozie_ambari_database', 'oozie_ambari_host']
+//        },
+//        {
+//          displayName: 'Existing Database',
+//          foreignKeys: ['oozie_existing_database', 'oozie_existing_host']
+//        }
+//      ],
+//      "description": "PostgreSQL will be installed by ambari. Any other database will have to be installed by the user.",
+//      "displayType": "radio button",
+//      "radioName": "oozie-database",
+//      "isVisible": true,
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_existing_database",
+//      "displayName": "Oozie Database",
+//      "value": "",
+//      "defaultValue": "MySQL",
+//      "description": "Select the database, if you already have existing one for Oozie.",
+//      "displayType": "combobox",
+//      "isVisible": false,
+//      "options": ['MySQL', 'PostgreSQL'],
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_existing_host",
+//      "displayName": "Database Host",
+//      "description": "Select the host on which the existing database is hosted.",
+//      "defaultValue": "",
+//      "isReconfigurable": false,
+//      "displayType": "host",
+//      "isVisible": false,
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_ambari_database",
+//      "displayName": "Oozie Database",
+//      "value": "",
+//      "defaultValue": "PostgreSQL",
+//      "description": "PostgreSQL will be installed by ambari.",
+//      "displayType": "masterHost",
+//      "isVisible": true,
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_ambari_host",
+//      "value": "",
+//      "defaultValue": "",
+//      "displayName": "PostgreSQL host",
+//      "description": "Host  on which the PostgreSQL database will be created by ambari. ",
+//      "isReconfigurable": false,
+//      "displayType": "masterHost",
+//      "isVisible": true,
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//
+
     {
       "id": "puppet var",
       "name": "oozie_database",
       "displayName": "Oozie Database",
       "value": "",
-      "defaultValue": "New PostgreSQL Database",
+      "defaultValue": "Current Derby Database",
       "options": [
         {
-          displayName: 'New PostgreSQL Database',
+          displayName: 'Current Derby Database',
+          foreignKeys: ['oozie_derby_database']
+        },
+        {
+          displayName: 'New MySQL Database',
           foreignKeys: ['oozie_ambari_database', 'oozie_ambari_host']
         },
         {
-          displayName: 'Existing Database',
-          foreignKeys: ['oozie_existing_database', 'oozie_existing_host']
+          displayName: 'Existing MySQL Database',
+          foreignKeys: ['oozie_existing_mysql_database', 'oozie_existing_mysql_host']
+        },
+        {
+          displayName: 'Existing Oracle Database',
+          foreignKeys: ['oozie_existing_oracle_database', 'oozie_existing_oracle_host']
         }
       ],
-      "description": "PostgreSQL will be installed by ambari. Any other database will have to be installed by the user.",
+      "description": "Current Derby Database will be installed by Ambari",
       "displayType": "radio button",
+      "isReconfigurable": false,
+      "isOverridable": false,
       "radioName": "oozie-database",
       "isVisible": true,
+      "domain": "global",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
+    // for current derby
     {
       "id": "puppet var",
-      "name": "oozie_existing_database",
-      "displayName": "Oozie Database",
+      "name": "oozie_derby_database",
+      "displayName": "Database Type",
+      "value": "",
+      "defaultValue": "Derby",
+      "description": "Using current Derby database for Oozie Metastore",
+      "displayType": "masterHost",
+      "isVisible": false,
+      "isReconfigurable": false,
+      "isOverridable": false,
+     // "domain": "global",
+      "serviceName": "OOZIE",
+      "category": "Oozie Server"
+    },
+    // for existing MySQL oozie
+    {
+      "id": "puppet var",
+      "name": "oozie_existing_mysql_database",
+      "displayName": "Database Type",
       "value": "",
       "defaultValue": "MySQL",
-      "description": "Select the database, if you already have existing one for Oozie.",
-      "displayType": "combobox",
+      "description": "Using an existing MySQL database for Oozie Metastore",
+      "displayType": "masterHost",
+      "isVisible": false,
+      "isReconfigurable": false,
+      "isOverridable": false,
+     //"domain": "global",
+      "serviceName": "OOZIE",
+      "category": "Oozie Server"
+    },
+    {
+      "id": "puppet var",
+      "name": "oozie_existing_mysql_host",
+      "displayName": "Database Host",
+      "description": "Specify the host on which the existing database is hosted",
+      "defaultValue": "",
+      "isReconfigurable": false,
+      "isOverridable": false,
+      "displayType": "host",
+      "isVisible": false,
+     //"domain": "global",
+      "serviceName": "OOZIE",
+      "category": "Oozie Server"
+    },
+    // for existing Oracle
+    {
+      "id": "puppet var",
+      "name": "oozie_existing_oracle_database",
+      "displayName": "Database Type",
+      "value": "",
+      "defaultValue": "Oracle",
+      "description": "Using an existing Oracle database for Oozie Metastore",
+      "displayType": "masterHost",
       "isVisible": false,
-      "options": ['MySQL', 'PostgreSQL'],
+      "isReconfigurable": false,
+      "isOverridable": false,
+    //"domain": "global",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
     {
       "id": "puppet var",
-      "name": "oozie_existing_host",
-      "displayName": "Database host",
-      "description": "Select the host on which the existing database is hosted.",
+      "name": "oozie_existing_oracle_host",
+      "displayName": "Database Host",
+      "description": "Specify the host on which the existing database is hosted",
       "defaultValue": "",
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "host",
       "isVisible": false,
+    //"domain": "global",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
+    // for new MySQL
     {
       "id": "puppet var",
       "name": "oozie_ambari_database",
-      "displayName": "Oozie Database",
+      "displayName": "Database Type",
       "value": "",
-      "defaultValue": "PostgreSQL",
-      "description": "PostgreSQL will be installed by ambari.",
+      "defaultValue": "MySQL",
+      "description": "MySQL will be installed by Ambari",
       "displayType": "masterHost",
-      "isVisible": true,
+      "isVisible": false,
+      "isOverridable": false,
+    // "domain": "global",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
@@ -2184,51 +2379,58 @@ module.exports =
       "name": "oozie_ambari_host",
       "value": "",
       "defaultValue": "",
-      "displayName": "PostgreSQL host",
-      "description": "Host  on which the PostgreSQL database will be created by ambari. ",
+      "displayName": "Database Host",
+      "description": "Host on which the database will be created by Ambari",
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "masterHost",
-      "isVisible": true,
+      "isVisible": false,
+     //"domain": "global",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
     {
       "id": "puppet var",
       "name": "oozie_database_name",
-      "displayName": "Database name",
+      "displayName": "Database Name",
       "description": "Database name used for the Oozie",
       "defaultValue": "oozie",
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "host",
       "isVisible": true,
+     //"domain": "global",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
     {
       "id": "puppet var",
       "name": "oozie_metastore_user_name",
-      "displayName": "Database user",
+      "displayName": "Database Username",
       "description": "Database user name to use to connect to the database",
       "defaultValue": "oozie",
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "user",
       "isVisible": true,
+     //"domain": "global",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
     {
       "id": "puppet var",
       "name": "oozie_metastore_user_passwd",
-      "displayName": "Database password",
-      "description": "Database password to use to connect to the PostgreSQL database",
+      "displayName": "Database Password",
+      "description": "Database password to use to connect to the database",
       "defaultValue": "",
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "password",
       "isVisible": true,
+    //"domain": "global",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
     },
-    */
     {
       "id": "puppet var",
       "name": "oozie_data_dir",