Explorar o código

AMBARI-11538. Ambari does not warn if hive tez container size exceeds yarn container max size - UI fix

Srimanth Gunturi %!s(int64=10) %!d(string=hai) anos
pai
achega
8cd80a1f48

+ 1 - 1
ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py

@@ -86,7 +86,7 @@ class HDP21StackAdvisor(HDP206StackAdvisor):
       yarnSchedulerMaximumAllocationMb = to_number(yarnSiteProperties["yarn.scheduler.maximum-allocation-mb"])
       hiveTezContainerSize = to_number(properties['hive.tez.container.size'])
       if hiveTezContainerSize is not None and yarnSchedulerMaximumAllocationMb is not None and hiveTezContainerSize > yarnSchedulerMaximumAllocationMb:
-        validationItems.append({"config-name": 'hive.tez.container.size', "item": self.getWarnItem("yarn.scheduler.maximum-allocation-mb is less than hive.tez.container.size")})
+        validationItems.append({"config-name": 'hive.tez.container.size', "item": self.getWarnItem("hive.tez.container.size is greater than the maximum container size specified in yarn.scheduler.maximum-allocation-mb")})
     return self.toConfigurationValidationProblems(validationItems, "hive-site")
 
   def validateTezConfigurations(self, properties, recommendedDefaults, configurations, services, hosts):

+ 1 - 1
ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py

@@ -525,7 +525,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     hbase_coprocessor_region_classes = None
     if 'hbase.coprocessor.region.classes' in configurations["hbase-site"]["properties"]:
       hbase_coprocessor_region_classes = configurations["hbase-site"]["properties"]["hbase.coprocessor.region.classes"].strip()
-    elif 'hbase.coprocessor.region.classes' in services['configurations']["hbase-site"]["properties"]:
+    elif 'hbase-site' in services['configurations'] and 'hbase.coprocessor.region.classes' in services['configurations']["hbase-site"]["properties"]:
       hbase_coprocessor_region_classes = services['configurations']["hbase-site"]["properties"]["hbase.coprocessor.region.classes"].strip()
     if hbase_coprocessor_region_classes:
       coprocessorRegionClassList = hbase_coprocessor_region_classes.split(',')

+ 5 - 2
ambari-web/app/mixins/common/configs/enhanced_configs.js

@@ -180,7 +180,9 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
    */
   setDependentServices: function(serviceName) {
     App.StackConfigProperty.find().forEach(function(stackProperty) {
-      if (stackProperty.get('serviceName') === serviceName && stackProperty.get('propertyDependedBy.length') > 0) {
+      if (stackProperty.get('serviceName') === serviceName &&
+        (stackProperty.get('propertyDependedBy.length') > 0 ||
+         stackProperty.get('propertyDependsOn.length') > 0)) {
         this._setDependentServicesAndFileNames(stackProperty, 'propertyDependedBy');
         this._setDependentServicesAndFileNames(stackProperty, 'propertyDependsOn');
       }
@@ -234,7 +236,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
    */
   removeCurrentFromDependentList: function (config, saveRecommended) {
     var current = this.get('_dependentConfigValues').find(function(dependentConfig) {
-      return Em.get(dependentConfig, 'propertyName') == config.get('name') && Em.get(dependentConfig, 'fileName') == App.config.getConfigTagFromFileName(config.get('filename'))
+      return Em.get(dependentConfig, 'propertyName') == config.get('name') && Em.get(dependentConfig, 'fileName') == App.config.getConfigTagFromFileName(config.get('filename'));
     });
     if (current) {
       Em.setProperties(current, {
@@ -375,6 +377,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
    * defines file names for configs and set them to <code>dependentFileNames<code> and
    * defines service names for configs and set them to <code>dependentServiceNames<code>
    * @param {App.StackConfigProperty} stackProperty
+   * @param {String} [key='propertyDependedBy'] - attribute to check dependent configs
    * @private
    */
   _setDependentServicesAndFileNames: function(stackProperty, key) {

+ 5 - 0
ambari-web/app/models/configs/stack_config_property.js

@@ -113,6 +113,11 @@ App.StackConfigProperty = DS.Model.extend({
    */
   propertyDependedBy: DS.attr('array', {defaultValue: []}),
 
+  /**
+   * this property contains list of file type and name of properties
+   * which values depends on current property
+   * @property {object[]}
+   */
   propertyDependsOn: DS.attr('array', {defaultValue: []}),
 
   /**

+ 12 - 1
ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js

@@ -52,6 +52,12 @@ describe('App.stackConfigPropertiesMapper', function () {
               "stack_name" : "HDP",
               "stack_version" : "2.2",
               "type" : "site1.xml",
+              "property_depends_on": [
+                {
+                  "name": "p5",
+                  "type": "site5"
+                }
+              ],
               "property_value_attributes": {
                 "type": "int",
                 "minimum": "512",
@@ -187,6 +193,12 @@ describe('App.stackConfigPropertiesMapper', function () {
           "name": "p4"
         }
       ]);
+      expect(App.StackConfigProperty.find('p1_site1').get('propertyDependsOn')).to.eql([
+        {
+          "type": "site5",
+          "name": "p5"
+        }
+      ]);
       expect(App.StackConfigProperty.find('p1_site1').get('valueAttributes')).to.eql({
         "type": "int",
         "minimum": "512",
@@ -207,4 +219,3 @@ describe('App.stackConfigPropertiesMapper', function () {
   });
 
 });
-