浏览代码

AMBARI-10803. Phoenix related config parameters should only be generated when phoenix_sql_enabled is true

Srimanth Gunturi 10 年之前
父节点
当前提交
c404871b54

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

@@ -363,13 +363,18 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
       putHbaseEnvPropertyAttributes('hbase_regionserver_heapsize', 'maximum', max(1024, int(min_ram*0.8/1024)))
 
     putHbaseSiteProperty = self.putProperty(configurations, "hbase-site", services)
+    putHbaseSitePropertyAttributes = self.putPropertyAttribute(configurations, "hbase-site")
     putHbaseSiteProperty("hbase.regionserver.global.memstore.upperLimit", '0.4')
 
     if 'hbase-env' in services['configurations'] and 'phoenix_sql_enabled' in services['configurations']['hbase-env']['properties']:
       if 'true' == services['configurations']['hbase-env']['properties']['phoenix_sql_enabled'].lower():
+        putHbaseSiteProperty("hbase.regionserver.rpc.scheduler.factory.class", "org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory")
+        putHbaseSiteProperty("hbase.rpc.controllerfactory.class", "org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory")
         putHbaseSiteProperty("hbase.regionserver.wal.codec", 'org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec')
       else:
         putHbaseSiteProperty("hbase.regionserver.wal.codec", 'org.apache.hadoop.hbase.regionserver.wal.WALCellCodec')
+        putHbaseSitePropertyAttributes('hbase.regionserver.rpc.scheduler.factory.class', 'delete', 'true')
+        putHbaseSitePropertyAttributes('hbase.rpc.controllerfactory.class', 'delete', 'true')
 
     servicesList = [service["StackServices"]["service_name"] for service in services["services"]]
     if 'ranger-hbase-plugin-properties' in services['configurations'] and ('ranger-hbase-plugin-enabled' in services['configurations']['ranger-hbase-plugin-properties']['properties']):

+ 0 - 22
ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/hbase-site.xml

@@ -40,26 +40,4 @@
     <value>16030</value>
     <description>The port for the HBase RegionServer web UI.</description>
   </property> 
-  <property>
-    <name>hbase.regionserver.rpc.scheduler.factory.class</name>
-    <display-name>RegionServer RPC scheduler factory class</display-name>
-    <value>org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory</value>
-    <depends-on>
-      <property>
-        <type>hbase-env</type>
-        <name>phoenix_sql_enabled</name>
-      </property>
-    </depends-on>
-  </property>
-  <property>
-    <name>hbase.rpc.controllerfactory.class</name>
-    <display-name>RPC controller factory class</display-name>
-    <value>org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory</value>
-    <depends-on>
-      <property>
-        <type>hbase-env</type>
-        <name>phoenix_sql_enabled</name>
-      </property>
-    </depends-on>
-  </property>
 </configuration>

+ 3 - 0
ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py

@@ -1406,6 +1406,8 @@ class TestHDP22StackAdvisor(TestCase):
       "hbase-site": {
         "properties": {
           "hbase.regionserver.wal.codec": "org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec",
+          "hbase.regionserver.rpc.scheduler.factory.class": "org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory",
+          "hbase.rpc.controllerfactory.class": "org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory",
           "hbase.bucketcache.size": "",
           "hbase.bucketcache.percentage.in.combinedcache": "",
           "hbase.regionserver.global.memstore.upperLimit": "0.4",
@@ -1431,6 +1433,7 @@ class TestHDP22StackAdvisor(TestCase):
     # Test when phoenix_sql_enabled = false
     services['configurations']['hbase-env']['properties']['phoenix_sql_enabled'] = 'false'
     expected['hbase-site']['properties']['hbase.regionserver.wal.codec'] = 'org.apache.hadoop.hbase.regionserver.wal.WALCellCodec'
+    expected['hbase-site']['property_attributes'] = {'hbase.regionserver.rpc.scheduler.factory.class': {'delete': 'true'}, 'hbase.rpc.controllerfactory.class': {'delete': 'true'}}
     self.stackAdvisor.recommendHBASEConfigurations(configurations, clusterData, services, None)
     self.assertEquals(configurations, expected)