This is an automated email from the ASF dual-hosted git repository. tdsilva pushed a commit to branch 4.x-HBase-1.4 in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push: new 8935a39 PHOENIX-5124 PropertyPolicyProvider should not evaluate default hbase config properties (addendum) 8935a39 is described below commit 8935a39b7477ca6dd33851b5d87cb2ef3cff9e5d 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)); } }