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/06/08 09:25:44 UTC

[phoenix-queryserver] branch master updated: PHOENIX-6489 Adopt PQS ITs to use Phoenix 5.1

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 dccc013  PHOENIX-6489 Adopt PQS ITs to use Phoenix 5.1
dccc013 is described below

commit dccc013ecef80cb5328b535952c7ec411523af65
Author: Istvan Toth <st...@apache.org>
AuthorDate: Tue Jun 8 08:49:19 2021 +0200

    PHOENIX-6489 Adopt PQS ITs to use Phoenix 5.1
---
 BUILDING.md                                        | 27 +++----
 phoenix-queryserver-it/pom.xml                     | 88 ++--------------------
 .../phoenix/end2end/QueryServerBasicsIT.java       | 36 +++++----
 .../phoenix/end2end/ServerCustomizersIT.java       |  8 +-
 .../tool/ParameterizedPhoenixCanaryToolIT.java     |  8 +-
 pom.xml                                            | 15 +++-
 6 files changed, 60 insertions(+), 122 deletions(-)

diff --git a/BUILDING.md b/BUILDING.md
index 74c0a9e..c6eeb2a 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -27,7 +27,7 @@ This repository will build a tarball which is capable of running the Phoenix Que
 
 By default, this tarball does not contain a Phoenix client jar as it is meant to be agnostic
 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.
+the Phoenix 5.1.1 release with HBase 2.4.2.
 
 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.
@@ -40,33 +40,24 @@ $ mvn clean package
 
 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, as well as
-the `phoenix.client.artifactid` to choose the phoenix-client HBase variant for 4.16+ / 5.1+.
+the `phoenix.client.artifactid` to choose the phoenix-client HBase variant.
 
 ```
-$ mvn clean package -Dpackage.phoenix.client -Dphoenix.version=5.1.0-SNAPSHOT -Dphoenix.client.artifactid=phoenix-client-hbase-2.4
+$ mvn clean package -Dpackage.phoenix.client -Dphoenix.version=5.1.1 -Dphoenix.client.artifactid=phoenix-client-hbase-2.4 -pl '!phoenix-queryserver-it'
+```
+```
+$ mvn clean package -Dpackage.phoenix.client -Dphoenix.version=4.15.0-HBase-1.4 -Dphoenix.client.artifactid=phoenix-client -pl '!phoenix-queryserver-it'
 ```
 
 ### 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 client artifact specified
-with `phoenix.version` and `phoenix.client.artifactid` is used for running the integration tests.
-
-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.1+ version, activate the `hbase-2.x` profile in addition to the
-profile for the minor 2.x version.
+The integration tests will run with the default Phoenix and HBase version.
+Running the integration tests with non-default Phoenix and HBase versions is not supported.
 
-**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 clean verify -Dpackage.phoenix.client -Dphoenix.version=4.16.0-SNAPSHOT -Dphoenix.client.artifactid=phoenix-client-hbase-1.3 -Phbase-1.3
-```
 ```
-$ 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
+$ mvn clean verify
 ```
 
 ### Running project reports
diff --git a/phoenix-queryserver-it/pom.xml b/phoenix-queryserver-it/pom.xml
index 92f683c..9f1cd62 100644
--- a/phoenix-queryserver-it/pom.xml
+++ b/phoenix-queryserver-it/pom.xml
@@ -151,6 +151,12 @@
     </dependency>
     <dependency>
       <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-asyncfs</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
       <artifactId>hbase-testing-util</artifactId>
       <scope>test</scope>
     </dependency>
@@ -187,86 +193,4 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-
-  <profiles>
-    <profile>
-      <id>hbase-2.x</id>
-      <properties>
-        <hbase.version>2.1.10</hbase.version>
-        <hadoop.version>3.0.3</hadoop.version>
-      </properties>
-      <dependencies>
-        <dependency>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-server</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-security</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.eclipse.jetty</groupId>
-          <artifactId>jetty-util</artifactId>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-    </profile>
-    <!-- These are only to be used if phoenix was compiled with a non-default
-      -Dhbase.profile -->
-    <profile>
-      <id>hbase-1.3</id>
-      <properties>
-        <hbase.version>1.3.5</hbase.version>
-      </properties>
-    </profile>
-    <profile>
-      <id>hbase-1.4</id>
-      <properties>
-        <hbase.version>1.4.10</hbase.version>
-      </properties>
-    </profile>
-    <profile>
-      <id>hbase-1.5</id>
-      <properties>
-        <hbase.version>1.5.0</hbase.version>
-      </properties>
-    </profile>
-    <profile>
-      <id>hbase-1.6</id>
-      <properties>
-        <hbase.version>1.6.0</hbase.version>
-        <hadoop.version>2.8.5</hadoop.version>
-      </properties>
-    </profile>
-    <profile>
-      <id>hbase-2.1</id>
-      <properties>
-        <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.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.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>
 </project>
diff --git a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerBasicsIT.java b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerBasicsIT.java
index 0540a3d..c4954a0 100644
--- a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerBasicsIT.java
+++ b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/QueryServerBasicsIT.java
@@ -39,9 +39,13 @@ import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.phoenix.query.BaseTest;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.queryserver.QueryServerProperties;
+import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.ThinClientUtil;
+import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Assume;
 import org.junit.BeforeClass;
@@ -55,7 +59,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Smoke test for query server.
  */
-public class QueryServerBasicsIT extends BaseHBaseManagedTimeIT {
+public class QueryServerBasicsIT extends BaseTest {
 
   private static final Logger LOG = LoggerFactory.getLogger(QueryServerBasicsIT.class);
 
@@ -67,20 +71,22 @@ public class QueryServerBasicsIT extends BaseHBaseManagedTimeIT {
   public TestName name = new TestName();
 
   @BeforeClass
-  public static synchronized void beforeClass() throws Exception {
-    CONF = getTestClusterConfig();
-    if(System.getProperty("do.not.randomize.pqs.port") == null) {
-        CONF.setInt(QueryServerProperties.QUERY_SERVER_HTTP_PORT_ATTRIB, 0);
-    }
-    String url = getUrl();
-    AVATICA_SERVER = new QueryServerThread(new String[] { url }, CONF,
-            QueryServerBasicsIT.class.getName());
-    AVATICA_SERVER.start();
-    AVATICA_SERVER.getQueryServer().awaitRunning();
-    final int port = AVATICA_SERVER.getQueryServer().getPort();
-    LOG.info("Avatica server started on port " + port);
-    CONN_STRING = ThinClientUtil.getConnectionUrl("localhost", port);
-    LOG.info("JDBC connection string is " + CONN_STRING);
+  public static synchronized void doSetup() throws Exception {
+      setUpTestDriver(ReadOnlyProps.EMPTY_PROPS);
+
+      CONF = config;
+      if(System.getProperty("do.not.randomize.pqs.port") == null) {
+          CONF.setInt(QueryServerProperties.QUERY_SERVER_HTTP_PORT_ATTRIB, 0);
+      }
+      String url = getUrl();
+      AVATICA_SERVER = new QueryServerThread(new String[] { url }, CONF,
+              QueryServerBasicsIT.class.getName());
+      AVATICA_SERVER.start();
+      AVATICA_SERVER.getQueryServer().awaitRunning();
+      final int port = AVATICA_SERVER.getQueryServer().getPort();
+      LOG.info("Avatica server started on port " + port);
+      CONN_STRING = ThinClientUtil.getConnectionUrl("localhost", port);
+      LOG.info("JDBC connection string is " + CONN_STRING);
   }
 
   @AfterClass
diff --git a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/ServerCustomizersIT.java b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/ServerCustomizersIT.java
index befe740..1b1ba80 100644
--- a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/ServerCustomizersIT.java
+++ b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/end2end/ServerCustomizersIT.java
@@ -23,11 +23,13 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.phoenix.query.BaseTest;
 import org.apache.phoenix.queryserver.QueryServerProperties;
 import org.apache.phoenix.queryserver.server.ServerCustomizersFactory;
 import org.apache.phoenix.queryserver.server.customizers.BasicAuthenticationServerCustomizer;
 import org.apache.phoenix.queryserver.server.customizers.BasicAuthenticationServerCustomizer.BasicAuthServerCustomizerFactory;
 import org.apache.phoenix.util.InstanceResolver;
+import org.apache.phoenix.util.ReadOnlyProps;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -37,7 +39,7 @@ import org.junit.rules.ExpectedException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class ServerCustomizersIT extends BaseHBaseManagedTimeIT {
+public class ServerCustomizersIT extends BaseTest {
     private static final Logger LOG = LoggerFactory.getLogger(ServerCustomizersIT.class);
     private static final String USER_NOT_AUTHORIZED = "user1";
 
@@ -48,7 +50,9 @@ public class ServerCustomizersIT extends BaseHBaseManagedTimeIT {
 
     @BeforeClass
     public static synchronized void setup() throws Exception {
-        Configuration conf = getTestClusterConfig();
+        setUpTestDriver(ReadOnlyProps.EMPTY_PROPS);
+
+        Configuration conf = config;
         PQS_UTIL = new QueryServerTestUtil(conf);
         PQS_UTIL.startLocalHBaseCluster(ServerCustomizersIT.class);
         // Register a test jetty server customizer
diff --git a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/tool/ParameterizedPhoenixCanaryToolIT.java b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/tool/ParameterizedPhoenixCanaryToolIT.java
index 7b7c02d..9827d95 100644
--- a/phoenix-queryserver-it/src/it/java/org/apache/phoenix/tool/ParameterizedPhoenixCanaryToolIT.java
+++ b/phoenix-queryserver-it/src/it/java/org/apache/phoenix/tool/ParameterizedPhoenixCanaryToolIT.java
@@ -74,6 +74,7 @@ public class ParameterizedPhoenixCanaryToolIT extends BaseTest {
 	private List<String> cmd = new ArrayList<>();
 	private String resultSinkOption;
 	private ByteArrayOutputStream out = new ByteArrayOutputStream();
+    private String tmpDir = System.getProperty("java.io.tmpdir");
 
 	public ParameterizedPhoenixCanaryToolIT(boolean isPositiveTestType,
 			boolean isNamespaceEnabled, String resultSinkOption) {
@@ -105,7 +106,12 @@ public class ParameterizedPhoenixCanaryToolIT extends BaseTest {
 		if(needsNewCluster()) {
 			setClientSideNamespaceProperties();
 			setServerSideNamespaceProperties();
-			tearDownMiniClusterAsync(1);
+			tearDownMiniCluster(NUM_SLAVES_BASE);
+			System.setProperty("java.io.tmpdir", tmpDir);
+			// FIXME no idea why java.io.tmpdir gets deleted. We don't see this behaviour in 
+			// the main phoenix repo with same versions
+			File tempDir = new File(tmpDir);
+			tempDir.mkdirs();
 			setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()),
 					new ReadOnlyProps(clientProps.entrySet().iterator()));
 			LOGGER.info("New cluster is spinned up with test parameters " +
diff --git a/pom.xml b/pom.xml
index 4c93d80..44c16a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,12 +68,12 @@
         <!-- General Properties -->
         <top.dir>${project.basedir}</top.dir>
 
-        <phoenix.version>4.15.0-HBase-1.4</phoenix.version>
+        <phoenix.version>5.1.1</phoenix.version>
 
         <!-- 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>
+        <hbase.version>2.4.2</hbase.version>
+        <hadoop.version>3.1.4</hadoop.version>
+        <phoenix.client.artifactid>phoenix-client-hbase-2.4</phoenix.client.artifactid>
 
         <!-- Dependency versions -->
         <zookeeper.version>3.5.8</zookeeper.version>
@@ -595,6 +595,13 @@
                 <type>test-jar</type>
                 <scope>test</scope>
             </dependency>
+            <dependency>
+                <groupId>org.apache.hbase</groupId>
+                <artifactId>hbase-asyncfs</artifactId>
+                <version>${hbase.version}</version>
+                <type>test-jar</type>
+                <scope>test</scope>
+            </dependency>
 
             <!-- Hadoop test dependencies -->
             <dependency>