You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2016/10/20 13:55:32 UTC

ambari git commit: AMBARI-18636. Remove hbase.rpc.controllerfactory.class from hbase-site.xml (magyari_sandor)

Repository: ambari
Updated Branches:
  refs/heads/trunk a954d832a -> febd71ea0


AMBARI-18636. Remove hbase.rpc.controllerfactory.class from hbase-site.xml (magyari_sandor)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/febd71ea
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/febd71ea
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/febd71ea

Branch: refs/heads/trunk
Commit: febd71ea06932697c556b0f2b608ed967f403f90
Parents: a954d83
Author: Sandor Magyari <sm...@hortonworks.com>
Authored: Wed Oct 19 18:42:32 2016 +0200
Committer: Sandor Magyari <sm...@hortonworks.com>
Committed: Thu Oct 20 15:51:47 2016 +0200

----------------------------------------------------------------------
 .../BlueprintConfigurationProcessor.java        | 39 ++++++++++++++++++++
 .../stacks/HDP/2.3/services/stack_advisor.py    |  6 ++-
 .../stacks/2.3/common/test_stack_advisor.py     |  1 -
 3 files changed, 44 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/febd71ea/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 8ff568a..8cc6ec7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -188,6 +188,10 @@ public class BlueprintConfigurationProcessor {
   private static final PropertyFilter[] clusterUpdatePropertyFilters =
     { new DependencyEqualsFilter("hbase.security.authorization", "hbase-site", "true"),
       new DependencyNotEqualsFilter("hive.server2.authentication", "hive-site", "NONE"),
+      /** Temporary solution related to HBASE/Phoenix issue PHOENIX-3360, to remove hbase.rpc.controllerfactory
+       * .class from hbase-site. */
+      new ConditionalPropertyFilter("hbase-site", "hbase.rpc.controllerfactory.class",
+        "org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory"),
       new HDFSNameNodeHAFilter(),
       new HawqHAFilter() };
 
@@ -3206,6 +3210,41 @@ public class BlueprintConfigurationProcessor {
   }
 
   /**
+   * Filter implementation filters out a property depending on property value.
+   */
+  private static class ConditionalPropertyFilter implements PropertyFilter {
+
+    private final String propertyName;
+    private final String propertyValue;
+    private final String configType;
+
+    public ConditionalPropertyFilter(String configType, String propertyName, String propertyValue) {
+      this.propertyName = propertyName;
+      this.propertyValue = propertyValue;
+      this.configType = configType;
+    }
+
+    /**
+     *
+     * @param propertyName property name
+     * @param propertyValue property value
+     * @param configType config type that contains this property
+     * @param topology cluster topology instance
+     *
+     * @return true if the property should be included
+     *         false if the property should not be included
+     */
+    @Override
+    public boolean isPropertyIncluded(String propertyName, String propertyValue, String configType, ClusterTopology topology) {
+      if (configType.equals(this.configType) && propertyName.equals(this.propertyName) && propertyValue.equals(this
+        .propertyValue)) {
+        return false;
+      }
+      return true;
+    }
+  }
+
+  /**
    * Filter implementation that scans for HAWQ HA properties that should be
    * removed/ignored when HAWQ HA is not enabled.
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/febd71ea/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index 517a6f3..d65248b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -206,7 +206,11 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
 
     if 'hbase-env' in services['configurations'] and 'phoenix_sql_enabled' in services['configurations']['hbase-env']['properties'] and \
        'true' == services['configurations']['hbase-env']['properties']['phoenix_sql_enabled'].lower():
-      putHbaseSiteProperty("hbase.rpc.controllerfactory.class", "org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory")
+      if 'hbase.rpc.controllerfactory.class' in services['configurations']['hbase-site']['properties'] and \
+          services['configurations']['hbase-site']['properties']['hbase.rpc.controllerfactory.class'] == \
+            'org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory':
+        putHbaseSitePropertyAttributes('hbase.rpc.controllerfactory.class', 'delete', 'true')
+
       putHbaseSiteProperty("hbase.region.server.rpc.scheduler.factory.class", "org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory")
     else:
       putHbaseSitePropertyAttributes('hbase.region.server.rpc.scheduler.factory.class', 'delete', 'true')

http://git-wip-us.apache.org/repos/asf/ambari/blob/febd71ea/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index 97a29b0..ad6842f 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -396,7 +396,6 @@ class TestHDP23StackAdvisor(TestCase):
           "hbase.coprocessor.region.classes": "org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint",
           "hbase.coprocessor.master.classes": "",
           "hbase.coprocessor.regionserver.classes": "",
-          "hbase.rpc.controllerfactory.class": "org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory",
           "hbase.region.server.rpc.scheduler.factory.class": "org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory",
           'hbase.regionserver.wal.codec': 'org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec',
           "hbase.bucketcache.ioengine": "offheap",