[phoenix] 04/34: PHOENIX-4750 Resolve server customizers and provide them to Avatica

2019-04-19 Thread tdsilva
This is an automated email from the ASF dual-hosted git repository.

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

commit dae5b0908cc172230026f50b956a1cc1dedb9ff6
Author: Alex Araujo 
AuthorDate: Mon Jun 4 16:32:10 2018 -0700

PHOENIX-4750 Resolve server customizers and provide them to Avatica

Resolve server customizers on the PQS classpath and provide them to the
HttpServer builder.

Signed-off-by: Josh Elser 
---
 .../org/apache/phoenix/query/QueryServices.java|   1 +
 .../apache/phoenix/query/QueryServicesOptions.java |   1 +
 .../phoenix/end2end/QueryServerTestUtil.java   | 187 +
 .../phoenix/end2end/ServerCustomizersIT.java   | 147 
 .../phoenix/queryserver/server/QueryServer.java|  26 ++-
 .../server/ServerCustomizersFactory.java   |  49 ++
 .../queryserver/server/ServerCustomizersTest.java  |  87 ++
 7 files changed, 496 insertions(+), 2 deletions(-)

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 48b7b7f..c7548df 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
@@ -252,6 +252,7 @@ public interface QueryServices extends SQLCloseable {
 public static final String QUERY_SERVER_SPNEGO_AUTH_DISABLED_ATTRIB = 
"phoenix.queryserver.spnego.auth.disabled";
 public static final String QUERY_SERVER_WITH_REMOTEUSEREXTRACTOR_ATTRIB = 
"phoenix.queryserver.withRemoteUserExtractor";
 public static final String QUERY_SERVER_REMOTEUSEREXTRACTOR_PARAM = 
"phoenix.queryserver.remoteUserExtractor.param";
+public static final String QUERY_SERVER_CUSTOMIZERS_ENABLED = 
"phoenix.queryserver.customizers.enabled";
 public static final String QUERY_SERVER_DISABLE_KERBEROS_LOGIN = 
"phoenix.queryserver.disable.kerberos.login";
 
 // metadata configs
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 307c5dd..7933ba0 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
@@ -301,6 +301,7 @@ public class QueryServicesOptions {
 public static final boolean DEFAULT_QUERY_SERVER_WITH_REMOTEUSEREXTRACTOR 
= false;
 public static final String DEFAULT_QUERY_SERVER_REMOTEUSEREXTRACTOR_PARAM 
= "doAs";
 public static final boolean DEFAULT_QUERY_SERVER_DISABLE_KERBEROS_LOGIN = 
false;
+public static final boolean DEFAULT_QUERY_SERVER_CUSTOMIZERS_ENABLED = 
false;
 
 public static final boolean DEFAULT_RENEW_LEASE_ENABLED = true;
 public static final int 
DEFAULT_RUN_RENEW_LEASE_FREQUENCY_INTERVAL_MILLISECONDS =
diff --git 
a/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
 
b/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
new file mode 100644
index 000..01f73ae
--- /dev/null
+++ 
b/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import java.io.File;
+import java.security.PrivilegedAction;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.LocalHBaseCluster;
+import org.apache.hadoop.hbase.util.FSUtils;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.phoenix.query.ConfigurationFactory;
+import org.apache.phoenix.queryserver.client.ThinClientUtil;
+import org.apache.phoenix.queryserver.server.QueryServer;
+import org.apache.phoenix.util.InstanceResolver;
+import org.slf4j.Logger;

[phoenix] 04/34: PHOENIX-4750 Resolve server customizers and provide them to Avatica

2019-04-19 Thread tdsilva
This is an automated email from the ASF dual-hosted git repository.

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

commit 567d8bbad2522fb816295d742bfce94cd534bb43
Author: Alex Araujo 
AuthorDate: Mon Jun 4 16:32:10 2018 -0700

PHOENIX-4750 Resolve server customizers and provide them to Avatica

Resolve server customizers on the PQS classpath and provide them to the
HttpServer builder.

Signed-off-by: Josh Elser 
---
 .../org/apache/phoenix/query/QueryServices.java|   1 +
 .../apache/phoenix/query/QueryServicesOptions.java |   1 +
 .../phoenix/end2end/QueryServerTestUtil.java   | 187 +
 .../phoenix/end2end/ServerCustomizersIT.java   | 147 
 .../phoenix/queryserver/server/QueryServer.java|  26 ++-
 .../server/ServerCustomizersFactory.java   |  49 ++
 .../queryserver/server/ServerCustomizersTest.java  |  87 ++
 7 files changed, 496 insertions(+), 2 deletions(-)

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 48b7b7f..c7548df 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
@@ -252,6 +252,7 @@ public interface QueryServices extends SQLCloseable {
 public static final String QUERY_SERVER_SPNEGO_AUTH_DISABLED_ATTRIB = 
"phoenix.queryserver.spnego.auth.disabled";
 public static final String QUERY_SERVER_WITH_REMOTEUSEREXTRACTOR_ATTRIB = 
"phoenix.queryserver.withRemoteUserExtractor";
 public static final String QUERY_SERVER_REMOTEUSEREXTRACTOR_PARAM = 
"phoenix.queryserver.remoteUserExtractor.param";
+public static final String QUERY_SERVER_CUSTOMIZERS_ENABLED = 
"phoenix.queryserver.customizers.enabled";
 public static final String QUERY_SERVER_DISABLE_KERBEROS_LOGIN = 
"phoenix.queryserver.disable.kerberos.login";
 
 // metadata configs
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 307c5dd..7933ba0 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
@@ -301,6 +301,7 @@ public class QueryServicesOptions {
 public static final boolean DEFAULT_QUERY_SERVER_WITH_REMOTEUSEREXTRACTOR 
= false;
 public static final String DEFAULT_QUERY_SERVER_REMOTEUSEREXTRACTOR_PARAM 
= "doAs";
 public static final boolean DEFAULT_QUERY_SERVER_DISABLE_KERBEROS_LOGIN = 
false;
+public static final boolean DEFAULT_QUERY_SERVER_CUSTOMIZERS_ENABLED = 
false;
 
 public static final boolean DEFAULT_RENEW_LEASE_ENABLED = true;
 public static final int 
DEFAULT_RUN_RENEW_LEASE_FREQUENCY_INTERVAL_MILLISECONDS =
diff --git 
a/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
 
b/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
new file mode 100644
index 000..01f73ae
--- /dev/null
+++ 
b/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import java.io.File;
+import java.security.PrivilegedAction;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.LocalHBaseCluster;
+import org.apache.hadoop.hbase.util.FSUtils;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.phoenix.query.ConfigurationFactory;
+import org.apache.phoenix.queryserver.client.ThinClientUtil;
+import org.apache.phoenix.queryserver.server.QueryServer;
+import org.apache.phoenix.util.InstanceResolver;
+import org.slf4j.Logger;

[phoenix] 04/34: PHOENIX-4750 Resolve server customizers and provide them to Avatica

2019-04-19 Thread tdsilva
This is an automated email from the ASF dual-hosted git repository.

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

commit 28fc50efe215354e4d2fc9974273f380fb1a9841
Author: Alex Araujo 
AuthorDate: Mon Jun 4 16:32:10 2018 -0700

PHOENIX-4750 Resolve server customizers and provide them to Avatica

Resolve server customizers on the PQS classpath and provide them to the
HttpServer builder.

Signed-off-by: Josh Elser 
---
 .../org/apache/phoenix/query/QueryServices.java|   1 +
 .../apache/phoenix/query/QueryServicesOptions.java |   1 +
 .../phoenix/end2end/QueryServerTestUtil.java   | 187 +
 .../phoenix/end2end/ServerCustomizersIT.java   | 147 
 .../phoenix/queryserver/server/QueryServer.java|  26 ++-
 .../server/ServerCustomizersFactory.java   |  49 ++
 .../queryserver/server/ServerCustomizersTest.java  |  87 ++
 7 files changed, 496 insertions(+), 2 deletions(-)

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 48b7b7f..c7548df 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
@@ -252,6 +252,7 @@ public interface QueryServices extends SQLCloseable {
 public static final String QUERY_SERVER_SPNEGO_AUTH_DISABLED_ATTRIB = 
"phoenix.queryserver.spnego.auth.disabled";
 public static final String QUERY_SERVER_WITH_REMOTEUSEREXTRACTOR_ATTRIB = 
"phoenix.queryserver.withRemoteUserExtractor";
 public static final String QUERY_SERVER_REMOTEUSEREXTRACTOR_PARAM = 
"phoenix.queryserver.remoteUserExtractor.param";
+public static final String QUERY_SERVER_CUSTOMIZERS_ENABLED = 
"phoenix.queryserver.customizers.enabled";
 public static final String QUERY_SERVER_DISABLE_KERBEROS_LOGIN = 
"phoenix.queryserver.disable.kerberos.login";
 
 // metadata configs
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 307c5dd..7933ba0 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
@@ -301,6 +301,7 @@ public class QueryServicesOptions {
 public static final boolean DEFAULT_QUERY_SERVER_WITH_REMOTEUSEREXTRACTOR 
= false;
 public static final String DEFAULT_QUERY_SERVER_REMOTEUSEREXTRACTOR_PARAM 
= "doAs";
 public static final boolean DEFAULT_QUERY_SERVER_DISABLE_KERBEROS_LOGIN = 
false;
+public static final boolean DEFAULT_QUERY_SERVER_CUSTOMIZERS_ENABLED = 
false;
 
 public static final boolean DEFAULT_RENEW_LEASE_ENABLED = true;
 public static final int 
DEFAULT_RUN_RENEW_LEASE_FREQUENCY_INTERVAL_MILLISECONDS =
diff --git 
a/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
 
b/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
new file mode 100644
index 000..01f73ae
--- /dev/null
+++ 
b/phoenix-queryserver/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import java.io.File;
+import java.security.PrivilegedAction;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.LocalHBaseCluster;
+import org.apache.hadoop.hbase.util.FSUtils;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.phoenix.query.ConfigurationFactory;
+import org.apache.phoenix.queryserver.client.ThinClientUtil;
+import org.apache.phoenix.queryserver.server.QueryServer;
+import org.apache.phoenix.util.InstanceResolver;
+import org.slf4j.Logger;