This is an automated email from the ASF dual-hosted git repository.
tdsilva pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
new bdb2b66 PHOENIX-5124 Add config to enable PropertyPolicyProvider
bdb2b66 is described below
commit bdb2b66d73683d2f116e130d53fa8978ccda5ccc
Author: Thomas D'Silva
AuthorDate: Thu Feb 14 16:14:18 2019 -0800
PHOENIX-5124 Add config to enable PropertyPolicyProvider
---
.../phoenix/end2end/PropertyPolicyProviderIT.java | 26 --
.../org/apache/phoenix/jdbc/PhoenixConnection.java | 7 --
.../org/apache/phoenix/query/QueryServices.java| 2 ++
.../apache/phoenix/query/QueryServicesOptions.java | 2 ++
.../org/apache/phoenix/util/PropertiesUtil.java| 26 --
.../phoenix/query/PropertyPolicyProviderTest.java | 10 +
6 files changed, 19 insertions(+), 54 deletions(-)
diff --git
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PropertyPolicyProviderIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PropertyPolicyProviderIT.java
deleted file mode 100644
index 48508a9..000
---
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PropertyPolicyProviderIT.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.apache.phoenix.end2end;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.hadoop.hbase.HConstants;
-import org.apache.phoenix.mapreduce.util.ConnectionUtil;
-import org.junit.Test;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.Properties;
-
-public class PropertyPolicyProviderIT extends ParallelStatsDisabledIT {
-
-@Test
-public void testUsingDefaultHBaseConfigs() throws SQLException {
-Configuration config = HBaseConfiguration.create();
-config.set(HConstants.ZOOKEEPER_QUORUM, getUrl());
-Properties properties=new Properties();
-properties.put("allowedProperty","value");
-try(
-Connection conn = ConnectionUtil.getInputConnection(config,
properties)
-){}
-}
-
-}
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
index d74..d668758 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
@@ -244,8 +244,11 @@ public class PhoenixConnection implements Connection,
MetaDataMutated, SQLClosea
this.isDescVarLengthRowKeyUpgrade = isDescVarLengthRowKeyUpgrade;
// Filter user provided properties based on property policy, if
-// provided.
-
PropertyPolicyProvider.getPropertyPolicy().evaluate(PropertiesUtil.removeStandardHBasePhoenixConfig(info));
+// provided and QueryServices.PROPERTY_POLICY_PROVIDER_ENABLED is true
+if
(Boolean.valueOf(info.getProperty(QueryServices.PROPERTY_POLICY_PROVIDER_ENABLED,
+
String.valueOf(QueryServicesOptions.DEFAULT_PROPERTY_POLICY_PROVIDER_ENABLED
{
+PropertyPolicyProvider.getPropertyPolicy().evaluate(info);
+}
// Copy so client cannot change
this.info = info == null ? new Properties() : PropertiesUtil
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
index 98e2ed3..9168367 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
@@ -309,6 +309,8 @@ public interface QueryServices extends SQLCloseable {
// whether to enable server side RS -> RS calls for upsert select
statements
public static final String ENABLE_SERVER_UPSERT_SELECT
="phoenix.client.enable.server.upsert.select";
+public static final String PROPERTY_POLICY_PROVIDER_ENABLED =
"phoenix.property.policy.provider.enabled";
+
// whether to trigger mutations on the server at all (UPSERT/DELETE or
DELETE FROM)
public static final String ENABLE_SERVER_SIDE_MUTATIONS
="phoenix.client.enable.server.mutations";
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
index 816d76f..5a8a1b6 100644
---
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
+++
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
@@ -349,6 +349,8 @@ public class QueryServicesOptions {
public static final boolean
DEFAULT_ALLOW_SPLITTABLE_SYSTEM_CATALOG_ROLLBACK = false;
+public static final boolean DEFAULT_PROPERTY_POLICY_PROVIDER_ENABLED =
true;
+