This is an automated email from the ASF dual-hosted git repository.
tdsilva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push:
new b5fb4c4 PHOENIX-5124 PropertyPolicyProvider should not evaluate
default hbase config properties (addendum)
b5fb4c4 is described below
commit b5fb4c47d4a7ef52a669f46f8606fdcd0f795214
Author: Thomas D'Silva <[email protected]>
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));
}
}