This is an automated email from the ASF dual-hosted git repository.

tdsilva pushed a commit to branch 4.x-HBase-1.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.2 by this push:
     new 2ba428d  PHOENIX-5124 PropertyPolicyProvider should not evaluate 
default hbase config properties (addendum)
2ba428d is described below

commit 2ba428d89892dfd8cfd3a63e9d50a88146e88a71
Author: Thomas D'Silva <tdsi...@apache.org>
AuthorDate: Thu Feb 7 18:15:12 2019 -0800

    PHOENIX-5124 PropertyPolicyProvider should not evaluate default hbase 
config properties (addendum)
---
 .../src/main/java/org/apache/phoenix/util/PropertiesUtil.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java
index b029a26..a52d979 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java
@@ -76,6 +76,7 @@ public class PropertiesUtil {
 
     /**
      * Removes properties present that are present in standard HBase 
configuration and standard Phoenix properties
+     * These are then evaluated by the PropertyPolicyProvider.
      */
     public static Properties removeStandardHBasePhoenixConfig(Properties 
props) {
         Configuration config = HBaseConfiguration.create();
@@ -83,10 +84,12 @@ public class PropertiesUtil {
         for(Entry entry: props.entrySet()) {
             if ( entry.getKey() instanceof String) {
                 String propName = (String) entry.getKey();
-                if (config.get(propName) == null
-                        && PhoenixEmbeddedDriver.DEFAULT_PROPS.get(propName) 
== null
+                // add the property to the normalized list if its not a 
standard Phoenix property and
+                // if the property is not defined in hbase-site.xml or if it 
is defined and its value is different
+                if ( PhoenixEmbeddedDriver.DEFAULT_PROPS.get(propName) == null
                         && !propName.equals(PhoenixRuntime.CURRENT_SCN_ATTRIB)
-                        && !propName.equals(PhoenixRuntime.TENANT_ID_ATTRIB)) {
+                        && !propName.equals(PhoenixRuntime.TENANT_ID_ATTRIB)
+                        && (config.get(propName) == null || 
!config.get(propName).equals(entry.getValue()) )) {
                     normalizedProps.put(propName, props.getProperty(propName));
                 }
             }

Reply via email to