You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2021/01/27 10:26:37 UTC

[phoenix-queryserver] branch master updated: PHOENIX-6325 Adapt queryserver build to the new phoenix-client artifactIds

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

stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 63d1bff  PHOENIX-6325 Adapt queryserver build to the new phoenix-client artifactIds
63d1bff is described below

commit 63d1bff0bc9cd3f9c7c2a4c427afe26c5f3fac32
Author: Istvan Toth <st...@apache.org>
AuthorDate: Mon Jan 4 11:15:01 2021 +0100

    PHOENIX-6325 Adapt queryserver build to the new phoenix-client artifactIds
---
 BUILDING.md                                        | 30 ++++++++++++----------
 phoenix-queryserver-assembly/pom.xml               |  4 +--
 .../src/assembly/cluster.xml                       |  2 +-
 phoenix-queryserver-it/pom.xml                     | 25 +++++++++++++-----
 .../phoenix/end2end/QueryServerEnvironment.java    |  5 ++--
 .../phoenix/end2end/QueryServerTestUtil.java       |  6 +++--
 .../end2end/SecureQueryServerPhoenixDBIT.java      |  5 ++--
 phoenix-queryserver/pom.xml                        |  2 +-
 pom.xml                                            |  3 ++-
 9 files changed, 52 insertions(+), 30 deletions(-)

diff --git a/BUILDING.md b/BUILDING.md
index ccf88ad..74c0a9e 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -29,40 +29,44 @@ By default, this tarball does not contain a Phoenix client jar as it is meant to
 of Phoenix version (one PQS release can be used against any Phoenix version). Today, PQS builds against
 the Phoenix 4.15.0-HBase-1.4 release.
 
+Note that the resulting Query Server binaries are not tied to any Phoenix, Hbase or Hadoop versions,
+and will work with all recent Phoenix versions.
+
 ```
-$ mvn package
+$ mvn clean package
 ```
 
 ### Bundling a Phoenix Client
 
 To build a release of PQS which packages a specific version of Phoenix, specify the `package-phoenix-client` system property
-and specify the `phoenix.version` system property to indicate a specific Phoenix version.
-
-PQS will package the same version of Phoenix used for build/test. This version is controlled by the
- `phoenix.version` system property.
+and specify the `phoenix.version` system property to indicate a specific Phoenix version, as well as
+the `phoenix.client.artifactid` to choose the phoenix-client HBase variant for 4.16+ / 5.1+.
 
 ```
-$ mvn package -Dpackage.phoenix.client -Dphoenix.version=5.1.0-SNAPSHOT
+$ mvn clean package -Dpackage.phoenix.client -Dphoenix.version=5.1.0-SNAPSHOT -Dphoenix.client.artifactid=phoenix-client-hbase-2.4
 ```
 
 ### Running integration tests
 
 `mvn package` will run the unit tests while building, but it will not run the integration test suite.
 
-The IT suite is run when executing `mvn install` or `mvn verify`. The Phoenix version specified
-with `phoenix.version` is used for running the integration tests.
+The IT suite is run when executing `mvn install` or `mvn verify`. The Phoenix client artifact specified
+with `phoenix.version` and `phoenix.client.artifactid` is used for running the integration tests.
 
-When specifying `phoenix.version`, also specify the HBase version to be used
-for integration testing by activating the corresponding `hbase<minor.major>` profile.
+When specifying `phoenix.version` and `phoenix.client.artifactid`, also specify the HBase version to
+be used for integration testing by activating the corresponding `hbase<minor.major>` profile.
 
-When using a Phoenix 5.x version, activate the `hbase-2.x` profile in addition to the
+When using a Phoenix 5.1+ version, activate the `hbase-2.x` profile in addition to the
 profile for the minor 2.x version.
 
+**NOTE** that the integration tests cannot be currently run with Phoenix 4.16+ or 5.1+, so the
+examples below will fail. See https://issues.apache.org/jira/browse/PHOENIX-6324
+
 ```
-$ mvn verify -Dpackage.phoenix.client -Dphoenix.version=4.16.0-SNAPSHOT -Phbase-1.3
+$ mvn clean verify -Dpackage.phoenix.client -Dphoenix.version=4.16.0-SNAPSHOT -Dphoenix.client.artifactid=phoenix-client-hbase-1.3 -Phbase-1.3
 ```
 ```
-$ mvn install -Dpackage.phoenix.client -Dphoenix.version=5.1.0-SNAPSHOT -Phbase-2.1 -Phbase-2.x
+$ mvn clean install -Dpackage.phoenix.client -Dphoenix.version=5.1.0-SNAPSHOT -Dphoenix.client.artifactid=phoenix-client-hbase-2.1 -Phbase-2.1 -Phbase-2.x
 ```
 
 ### Running project reports
diff --git a/phoenix-queryserver-assembly/pom.xml b/phoenix-queryserver-assembly/pom.xml
index 25286de..3d6baaf 100644
--- a/phoenix-queryserver-assembly/pom.xml
+++ b/phoenix-queryserver-assembly/pom.xml
@@ -82,7 +82,7 @@
                     <goal>copy-dependencies</goal>
                   </goals>
                   <configuration>
-                    <includeArtifactIds>phoenix-client,phoenix-queryserver-client</includeArtifactIds>
+                    <includeArtifactIds>${phoenix.client.artifactid},phoenix-queryserver-client</includeArtifactIds>
                     <outputDirectory>${project.build.directory}/maven-repo</outputDirectory>
                     <overWriteIfNewer>true</overWriteIfNewer>
                     <useRepositoryLayout>true</useRepositoryLayout>
@@ -120,7 +120,7 @@
             <dependencies>
                 <dependency>
                     <groupId>org.apache.phoenix</groupId>
-                    <artifactId>phoenix-client</artifactId>
+                    <artifactId>${phoenix.client.artifactid}</artifactId>
                 </dependency>
             </dependencies>
         </profile>
diff --git a/phoenix-queryserver-assembly/src/assembly/cluster.xml b/phoenix-queryserver-assembly/src/assembly/cluster.xml
index 356968b..bb7daf0 100644
--- a/phoenix-queryserver-assembly/src/assembly/cluster.xml
+++ b/phoenix-queryserver-assembly/src/assembly/cluster.xml
@@ -65,7 +65,7 @@
         <unpack>false</unpack>
         <outputDirectory>phoenix-queryserver-${project.parent.version}/</outputDirectory>
         <includes>
-          <include>org.apache.phoenix:phoenix-client:jar</include>
+          <include>org.apache.phoenix:${phoenix.client.artifactid}:jar</include>
         </includes>
       </dependencySet>
     </dependencySets>
diff --git a/phoenix-queryserver-it/pom.xml b/phoenix-queryserver-it/pom.xml
index 45684e9..92f683c 100644
--- a/phoenix-queryserver-it/pom.xml
+++ b/phoenix-queryserver-it/pom.xml
@@ -102,7 +102,8 @@
     <!-- We still need unshaded Hadoop+Hbase deps for running the minicluster -->
     <dependency>
       <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix-client</artifactId>
+      <artifactId>${phoenix.client.artifactid}</artifactId>
+      <version>${phoenix.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -140,6 +141,11 @@
     <dependency>
       <groupId>org.apache.hbase</groupId>
       <artifactId>hbase-server</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-server</artifactId>
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
@@ -186,7 +192,7 @@
     <profile>
       <id>hbase-2.x</id>
       <properties>
-        <hbase.version>2.1.9</hbase.version>
+        <hbase.version>2.1.10</hbase.version>
         <hadoop.version>3.0.3</hadoop.version>
       </properties>
       <dependencies>
@@ -237,22 +243,29 @@
     <profile>
       <id>hbase-2.1</id>
       <properties>
-        <hbase.version>2.1.9</hbase.version>
+        <hbase.version>2.1.10</hbase.version>
         <hadoop.version>3.0.3</hadoop.version>
       </properties>
     </profile>
     <profile>
       <id>hbase-2.2</id>
       <properties>
-        <hbase.version>2.2.5</hbase.version>
-        <hadoop.version>3.1.2</hadoop.version>
+        <hbase.version>2.2.6</hbase.version>
+        <hadoop.version>3.1.3</hadoop.version>
       </properties>
     </profile>
     <profile>
       <id>hbase-2.3</id>
       <properties>
         <hbase.version>2.3.0</hbase.version>
-        <hadoop.version>3.1.2</hadoop.version>
+        <hadoop.version>3.1.3</hadoop.version>
+      </properties>
+    </profile>
+    <profile>
+      <id>hbase-2.4</id>
+      <properties>
+        <hbase.version>2.4.0</hbase.version>
+        <hadoop.version>3.1.4</hadoop.version>
       </properties>
     </profile>
   </profiles>
diff --git a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java
index 7bb6c9e..40e6c04 100644
--- a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java
+++ b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerEnvironment.java
@@ -10,6 +10,7 @@
  */
 package org.apache.phoenix.end2end;
 
+import static org.apache.hadoop.hbase.HConstants.HBASE_DIR;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
@@ -34,7 +35,6 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.LocalHBaseCluster;
 import org.apache.hadoop.hbase.security.HBaseKerberosUtils;
-import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.http.HttpConfig;
 import org.apache.hadoop.minikdc.MiniKdc;
@@ -285,7 +285,8 @@ public class QueryServerEnvironment {
         // NB. I'm not actually sure what HTU does incorrect, but this was pulled from some test
         // classes in HBase itself. I couldn't get HTU to work myself (2017/07/06)
         Path rootdir = UTIL.getDataTestDirOnTestFS(QueryServerEnvironment.class.getSimpleName());
-        FSUtils.setRootDir(conf, rootdir);
+        // There is no setRootdir method that is available in all supported HBase versions.
+        conf.set(HBASE_DIR, rootdir.toString());
         HBASE_CLUSTER = new LocalHBaseCluster(conf, 1);
         HBASE_CLUSTER.startup();
 
diff --git a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
index 92977a0..0296ea4 100644
--- a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
+++ b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerTestUtil.java
@@ -16,6 +16,8 @@
  */
 package org.apache.phoenix.end2end;
 
+import static org.apache.hadoop.hbase.HConstants.HBASE_DIR;
+
 import java.io.File;
 import java.security.PrivilegedAction;
 import java.util.Map;
@@ -28,7 +30,6 @@ 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.server.QueryServer;
@@ -79,7 +80,8 @@ public class QueryServerTestUtil {
         util.startMiniDFSCluster(1);
         // Start HBase
         Path rootdir = util.getDataTestDirOnTestFS(uniqueName);
-        FSUtils.setRootDir(conf, rootdir);
+        // There is no setRootdir method that is available in all supported HBase versions.
+        conf.set(HBASE_DIR, rootdir.toString());
         hbase = new LocalHBaseCluster(conf, 1);
         hbase.startup();
     }
diff --git a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/SecureQueryServerPhoenixDBIT.java b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/SecureQueryServerPhoenixDBIT.java
index f498683..162285e 100644
--- a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/SecureQueryServerPhoenixDBIT.java
+++ b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/SecureQueryServerPhoenixDBIT.java
@@ -16,6 +16,7 @@
  */
 package org.apache.phoenix.end2end;
 
+import static org.apache.hadoop.hbase.HConstants.HBASE_DIR;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -51,7 +52,6 @@ import org.apache.hadoop.hbase.LocalHBaseCluster;
 import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
 import org.apache.hadoop.hbase.security.HBaseKerberosUtils;
 import org.apache.hadoop.hbase.security.token.TokenProvider;
-import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.http.HttpConfig;
 import org.apache.hadoop.minikdc.MiniKdc;
@@ -274,7 +274,8 @@ public class SecureQueryServerPhoenixDBIT {
         // NB. I'm not actually sure what HTU does incorrect, but this was pulled from some test
         //     classes in HBase itself. I couldn't get HTU to work myself (2017/07/06)
         Path rootdir = UTIL.getDataTestDirOnTestFS(SecureQueryServerPhoenixDBIT.class.getSimpleName());
-        FSUtils.setRootDir(conf, rootdir);
+        // There is no setRootdir method that is available in all supported HBase versions.
+        conf.set(HBASE_DIR, rootdir.toString());
         HBASE_CLUSTER = new LocalHBaseCluster(conf, 1);
         HBASE_CLUSTER.startup();
 
diff --git a/phoenix-queryserver/pom.xml b/phoenix-queryserver/pom.xml
index 710518b..fd81154 100644
--- a/phoenix-queryserver/pom.xml
+++ b/phoenix-queryserver/pom.xml
@@ -226,7 +226,7 @@
     <!-- for tests -->
     <dependency>
       <groupId>org.apache.phoenix</groupId>
-      <artifactId>phoenix-client</artifactId>
+      <artifactId>${phoenix.client.artifactid}</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
diff --git a/pom.xml b/pom.xml
index ef16bbd..dce82dc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,7 @@
         <!-- Hadoop/Hbase Versions -->
         <hbase.version>1.4.10</hbase.version>
         <hadoop.version>2.7.5</hadoop.version>
+        <phoenix.client.artifactid>phoenix-client</phoenix.client.artifactid>
 
         <!-- Dependency versions -->
         <zookeeper.version>3.5.8</zookeeper.version>
@@ -373,7 +374,7 @@
         <dependencies>
             <dependency>
                 <groupId>org.apache.phoenix</groupId>
-                <artifactId>phoenix-client</artifactId>
+                <artifactId>${phoenix.client.artifactid}</artifactId>
                 <version>${phoenix.version}</version>
             </dependency>