Pārlūkot izejas kodu

AMBARI-11703. HBASE configs validation error on 'hbase.bucketcache.ioengine' (srimanth)

Srimanth Gunturi 10 gadi atpakaļ
vecāks
revīzija
e5e2cfd417

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

@@ -967,7 +967,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     # Validate bucket cache correct config
     # Validate bucket cache correct config
     prop_name = "hbase.bucketcache.ioengine"
     prop_name = "hbase.bucketcache.ioengine"
     prop_val = "offheap"
     prop_val = "offheap"
-    if not (not hbase_site[prop_name] or hbase_site[prop_name] == prop_val):
+    if prop_name in hbase_site and not (not hbase_site[prop_name] or hbase_site[prop_name] == prop_val):
       validationItems.append({"config-name": prop_name,
       validationItems.append({"config-name": prop_name,
                               "item": self.getWarnItem(
                               "item": self.getWarnItem(
                                 "Recommended values of " \
                                 "Recommended values of " \
@@ -977,11 +977,11 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     prop_name2 = "hbase.bucketcache.size"
     prop_name2 = "hbase.bucketcache.size"
     prop_name3 = "hbase.bucketcache.percentage.in.combinedcache"
     prop_name3 = "hbase.bucketcache.percentage.in.combinedcache"
 
 
-    if hbase_site[prop_name1] and not hbase_site[prop_name2]:
+    if prop_name1 in hbase_site and prop_name2 in hbase_site and hbase_site[prop_name1] and not hbase_site[prop_name2]:
       validationItems.append({"config-name": prop_name2,
       validationItems.append({"config-name": prop_name2,
                               "item": self.getWarnItem(
                               "item": self.getWarnItem(
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name2))})
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name2))})
-    if hbase_site[prop_name1] and not hbase_site[prop_name3]:
+    if prop_name1 in hbase_site and prop_name3 in hbase_site and hbase_site[prop_name1] and not hbase_site[prop_name3]:
       validationItems.append({"config-name": prop_name3,
       validationItems.append({"config-name": prop_name3,
                               "item": self.getWarnItem(
                               "item": self.getWarnItem(
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name3))})
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name3))})
@@ -1008,7 +1008,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     hbase_site_properties = getSiteProperties(configurations, "hbase-site")
     hbase_site_properties = getSiteProperties(configurations, "hbase-site")
     prop_name1 = "hbase.bucketcache.ioengine"
     prop_name1 = "hbase.bucketcache.ioengine"
 
 
-    if hbase_site_properties[prop_name1] and hbase_site_properties[prop_name1] == "offheap" and not hbase_env[prop_name]:
+    if prop_name1 in hbase_site_properties and prop_name in hbase_env and hbase_site_properties[prop_name1] and hbase_site_properties[prop_name1] == "offheap" and not hbase_env[prop_name]:
       validationItems.append({"config-name": prop_name,
       validationItems.append({"config-name": prop_name,
                               "item": self.getWarnItem(
                               "item": self.getWarnItem(
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name))})
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name))})

+ 4 - 4
ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/stack_advisor.py

@@ -949,7 +949,7 @@ class HDPWIN22StackAdvisor(HDPWIN21StackAdvisor):
     # Validate bucket cache correct config
     # Validate bucket cache correct config
     prop_name = "hbase.bucketcache.ioengine"
     prop_name = "hbase.bucketcache.ioengine"
     prop_val = "offheap"
     prop_val = "offheap"
-    if not (not hbase_site[prop_name] or hbase_site[prop_name] == prop_val):
+    if prop_name in hbase_site and not (not hbase_site[prop_name] or hbase_site[prop_name] == prop_val):
       validationItems.append({"config-name": prop_name,
       validationItems.append({"config-name": prop_name,
                               "item": self.getWarnItem(
                               "item": self.getWarnItem(
                                 "Recommended values of " \
                                 "Recommended values of " \
@@ -959,11 +959,11 @@ class HDPWIN22StackAdvisor(HDPWIN21StackAdvisor):
     prop_name2 = "hbase.bucketcache.size"
     prop_name2 = "hbase.bucketcache.size"
     prop_name3 = "hbase.bucketcache.percentage.in.combinedcache"
     prop_name3 = "hbase.bucketcache.percentage.in.combinedcache"
 
 
-    if hbase_site[prop_name1] and not hbase_site[prop_name2]:
+    if prop_name1 in hbase_site and prop_name2 in hbase_site and hbase_site[prop_name1] and not hbase_site[prop_name2]:
       validationItems.append({"config-name": prop_name2,
       validationItems.append({"config-name": prop_name2,
                               "item": self.getWarnItem(
                               "item": self.getWarnItem(
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name2))})
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name2))})
-    if hbase_site[prop_name1] and not hbase_site[prop_name3]:
+    if prop_name1 in hbase_site and prop_name3 in hbase_site and hbase_site[prop_name1] and not hbase_site[prop_name3]:
       validationItems.append({"config-name": prop_name3,
       validationItems.append({"config-name": prop_name3,
                               "item": self.getWarnItem(
                               "item": self.getWarnItem(
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name3))})
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name3))})
@@ -990,7 +990,7 @@ class HDPWIN22StackAdvisor(HDPWIN21StackAdvisor):
     hbase_site_properties = getSiteProperties(configurations, "hbase-site")
     hbase_site_properties = getSiteProperties(configurations, "hbase-site")
     prop_name1 = "hbase.bucketcache.ioengine"
     prop_name1 = "hbase.bucketcache.ioengine"
 
 
-    if hbase_site_properties[prop_name1] and hbase_site_properties[prop_name1] == "offheap" and not hbase_env[prop_name]:
+    if prop_name1 in hbase_site_properties and prop_name in hbase_env and hbase_site_properties[prop_name1] and hbase_site_properties[prop_name1] == "offheap" and not hbase_env[prop_name]:
       validationItems.append({"config-name": prop_name,
       validationItems.append({"config-name": prop_name,
                               "item": self.getWarnItem(
                               "item": self.getWarnItem(
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name))})
                                 "If bucketcache ioengine is enabled, {0} should be set".format(prop_name))})