You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2022/06/28 05:26:04 UTC

[pulsar] branch master updated: [pulsar-sql] Bump presto.version to run PrestoServer on JDK11+ (#16163)

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

penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new b596a9cff71 [pulsar-sql] Bump presto.version to run PrestoServer on JDK11+ (#16163)
b596a9cff71 is described below

commit b596a9cff714bee0fa1d767d5966d37abc399573
Author: tison <wa...@gmail.com>
AuthorDate: Tue Jun 28 13:25:57 2022 +0800

    [pulsar-sql] Bump presto.version to run PrestoServer on JDK11+ (#16163)
---
 .asf.yaml                                          |  3 +-
 conf/presto/config.properties                      |  2 -
 conf/presto/jvm.config                             |  1 -
 pom.xml                                            |  2 +-
 pulsar-sql/java-version-trim-agent/pom.xml         | 58 ----------------------
 .../pulsar/sql/agent/TrimJavaVersionAgent.java     | 51 -------------------
 .../org/apache/pulsar/sql/agent/package-info.java  | 22 --------
 pulsar-sql/pom.xml                                 |  2 -
 pulsar-sql/presto-distribution/LICENSE             | 23 +++++----
 pulsar-sql/presto-distribution/pom.xml             |  9 +---
 .../presto-distribution/src/assembly/assembly.xml  |  5 --
 src/check-binary-license.sh                        |  2 +-
 .../latest-version-image/conf/presto/jvm.config    |  1 -
 .../resources/presto-coordinator-config.properties |  2 -
 .../presto-follow-worker-config.properties         |  2 -
 15 files changed, 16 insertions(+), 169 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 1bef336ff6d..bf773871b68 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -77,8 +77,7 @@ github:
           - CI - System - Schema
           - CI - System - Tiered FileSystem
           - CI - System - Tiered JCloud
-# Sql integration tests are disabled until https://github.com/apache/pulsar/issues/14951 has been resolved
-#          - CI - System - Sql
+          - CI - System - Sql
 
       required_pull_request_reviews:
         dismiss_stale_reviews: false
diff --git a/conf/presto/config.properties b/conf/presto/config.properties
index f98b29ab7b8..8915a677d3a 100644
--- a/conf/presto/config.properties
+++ b/conf/presto/config.properties
@@ -37,6 +37,4 @@ scheduler.http-client.idle-timeout=1m
 query.client.timeout=5m
 query.min-expire-age=30m
 
-presto.version=testversion
-
 node-scheduler.include-coordinator=true
diff --git a/conf/presto/jvm.config b/conf/presto/jvm.config
index bf31a5b0084..86c9d0613b2 100644
--- a/conf/presto/jvm.config
+++ b/conf/presto/jvm.config
@@ -26,4 +26,3 @@
 -XX:+ExitOnOutOfMemoryError
 -Dpresto-temporarily-allow-java8=true
 -Djdk.attach.allowAttachSelf=true
--javaagent:java-version-trim-agent.jar
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 02f3301136b..db8f278abf6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -169,7 +169,7 @@ flexible messaging model and an intuitive client API.</description>
     <json-smart.version>2.4.7</json-smart.version>
     <opensearch.version>1.2.4</opensearch.version>
     <elasticsearch-java.version>8.1.0</elasticsearch-java.version>
-    <presto.version>332</presto.version>
+    <presto.version>334</presto.version>
     <scala.binary.version>2.13</scala.binary.version>
     <scala-library.version>2.13.6</scala-library.version>
     <debezium.version>1.7.2.Final</debezium.version>
diff --git a/pulsar-sql/java-version-trim-agent/pom.xml b/pulsar-sql/java-version-trim-agent/pom.xml
deleted file mode 100644
index de279df3107..00000000000
--- a/pulsar-sql/java-version-trim-agent/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<!--
-
-    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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>pulsar-sql</artifactId>
-        <groupId>org.apache.pulsar</groupId>
-        <version>2.11.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>java-version-trim-agent</artifactId>
-    <name>Pulsar SQL :: Java Version Trim Agent</name>
-
-    <build>
-        <finalName>java-version-trim-agent</finalName>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>3.1.0</version>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <addClasspath>true</addClasspath>
-                        </manifest>
-                        <manifestEntries>
-                            <Premain-Class>org.apache.pulsar.sql.agent.TrimJavaVersionAgent</Premain-Class>
-                            <Agent-Class>org.apache.pulsar.sql.agent.TrimJavaVersionAgent</Agent-Class>
-                            <Can-Redefine-Classes>true</Can-Redefine-Classes>
-                            <Can-Retransform-Classes>true</Can-Retransform-Classes>
-                        </manifestEntries>
-                    </archive>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
\ No newline at end of file
diff --git a/pulsar-sql/java-version-trim-agent/src/main/java/org/apache/pulsar/sql/agent/TrimJavaVersionAgent.java b/pulsar-sql/java-version-trim-agent/src/main/java/org/apache/pulsar/sql/agent/TrimJavaVersionAgent.java
deleted file mode 100644
index 7cb422bd27a..00000000000
--- a/pulsar-sql/java-version-trim-agent/src/main/java/org/apache/pulsar/sql/agent/TrimJavaVersionAgent.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * 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.pulsar.sql.agent;
-
-import java.lang.instrument.Instrumentation;
-import java.util.logging.Logger;
-
-/**
- * The presto 332 couldn't parse Java version like this `11.0.14.1`,
- * so add java version trim agent to walk around the problem.
- *
- * After the presto upgrade to 332+, we could remove this.
- */
-public class TrimJavaVersionAgent {
-
-    private static final Logger logger = Logger.getLogger(TrimJavaVersionAgent.class.getName());
-
-    private static final String JAVA_VERSION = "java.version";
-
-    public static String trimJavaVersion(String javaVersion) {
-        String[] arr = javaVersion.split("\\.");
-        if (arr.length <= 3) {
-            return javaVersion;
-        }
-        return arr[0] + "." + arr[1] + "." + arr[2];
-    }
-
-    public static void premain(String agentArgs, Instrumentation inst) {
-        String javaVersion = System.getProperty(JAVA_VERSION);
-        String trimVersion = trimJavaVersion(javaVersion);
-        logger.info("original java version " + javaVersion + " => trim java version " + trimVersion);
-        System.setProperty(JAVA_VERSION, trimVersion);
-    }
-
-}
diff --git a/pulsar-sql/java-version-trim-agent/src/main/java/org/apache/pulsar/sql/agent/package-info.java b/pulsar-sql/java-version-trim-agent/src/main/java/org/apache/pulsar/sql/agent/package-info.java
deleted file mode 100644
index 7d60a6fc6fb..00000000000
--- a/pulsar-sql/java-version-trim-agent/src/main/java/org/apache/pulsar/sql/agent/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * 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.
- */
-/**
- * Implementation of the connector to the Presto engine.
- */
-package org.apache.pulsar.sql.agent;
diff --git a/pulsar-sql/pom.xml b/pulsar-sql/pom.xml
index 71b951b5b5e..edc98c53d36 100644
--- a/pulsar-sql/pom.xml
+++ b/pulsar-sql/pom.xml
@@ -183,7 +183,6 @@
             <modules>
                 <module>presto-pulsar</module>
                 <module>presto-pulsar-plugin</module>
-                <module>java-version-trim-agent</module>
                 <module>presto-distribution</module>
             </modules>
         </profile>
@@ -192,7 +191,6 @@
             <modules>
                 <module>presto-pulsar</module>
                 <module>presto-pulsar-plugin</module>
-                <module>java-version-trim-agent</module>
                 <module>presto-distribution</module>
             </modules>
         </profile>
diff --git a/pulsar-sql/presto-distribution/LICENSE b/pulsar-sql/presto-distribution/LICENSE
index 8126989428e..c1893d943ce 100644
--- a/pulsar-sql/presto-distribution/LICENSE
+++ b/pulsar-sql/presto-distribution/LICENSE
@@ -394,17 +394,18 @@ The Apache Software License, Version 2.0
   * Okio
     - okio-1.17.2.jar
   * Presto
-    - presto-array-332.jar
-    - presto-cli-332.jar
-    - presto-client-332.jar
-    - presto-geospatial-toolkit-332.jar
-    - presto-main-332.jar
-    - presto-matching-332.jar
-    - presto-memory-context-332.jar
-    - presto-parser-332.jar
-    - presto-plugin-toolkit-332.jar
-    - presto-spi-332.jar
-    - presto-record-decoder-332.jar
+    - presto-array-334.jar
+    - presto-cli-334.jar
+    - presto-client-334.jar
+    - presto-geospatial-toolkit-334.jar
+    - presto-main-334.jar
+    - presto-matching-334.jar
+    - presto-memory-context-334.jar
+    - presto-parser-334.jar
+    - presto-plugin-toolkit-334.jar
+    - presto-server-main-334.jar
+    - presto-spi-334.jar
+    - presto-record-decoder-334.jar
   * RocksDB JNI
     - rocksdbjni-6.10.2.jar
   * SnakeYAML
diff --git a/pulsar-sql/presto-distribution/pom.xml b/pulsar-sql/presto-distribution/pom.xml
index d326f81508b..a35e3f00519 100644
--- a/pulsar-sql/presto-distribution/pom.xml
+++ b/pulsar-sql/presto-distribution/pom.xml
@@ -81,7 +81,7 @@
 
     <dependency>
       <groupId>io.prestosql</groupId>
-      <artifactId>presto-main</artifactId>
+      <artifactId>presto-server-main</artifactId>
       <version>${presto.version}</version>
       <exclusions>
         <!-- exclude openjdk because of GPL license -->
@@ -194,13 +194,6 @@
       <version>${jackson.version}</version>
     </dependency>
 
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>java-version-trim-agent</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-
   </dependencies>
 
   <dependencyManagement>
diff --git a/pulsar-sql/presto-distribution/src/assembly/assembly.xml b/pulsar-sql/presto-distribution/src/assembly/assembly.xml
index bc1fe5ed460..4f1bac20dce 100644
--- a/pulsar-sql/presto-distribution/src/assembly/assembly.xml
+++ b/pulsar-sql/presto-distribution/src/assembly/assembly.xml
@@ -40,11 +40,6 @@
             <outputDirectory>bin/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
-        <file>
-            <source>${basedir}/../java-version-trim-agent/target/java-version-trim-agent.jar</source>
-            <destName>java-version-trim-agent.jar</destName>
-            <outputDirectory>/</outputDirectory>
-        </file>
     </files>
     <fileSets>
         <fileSet>
diff --git a/src/check-binary-license.sh b/src/check-binary-license.sh
index 7c7b9990d34..bdf55b3a0b1 100755
--- a/src/check-binary-license.sh
+++ b/src/check-binary-license.sh
@@ -96,7 +96,7 @@ done
 
 if [ "$NO_PRESTO" -ne 1 ]; then
   # check pulsar sql jars
-  JARS=$(tar -tf $TARBALL | grep '\.jar' | grep 'lib/presto/' | grep -v pulsar-client | grep -v bouncy-castle-bc | grep -v pulsar-metadata | grep -v 'managed-ledger' | grep -v  'pulsar-client-admin' | grep -v  'pulsar-client-api' | grep -v 'pulsar-functions-api' | grep -v 'pulsar-presto-connector-original' | grep -v 'pulsar-presto-distribution' | grep -v 'pulsar-common' | grep -v 'pulsar-functions-proto' | grep -v 'pulsar-functions-utils' | grep -v 'pulsar-io-core' | grep -v 'pulsar-tran [...]
+  JARS=$(tar -tf $TARBALL | grep '\.jar' | grep 'lib/presto/' | grep -v pulsar-client | grep -v bouncy-castle-bc | grep -v pulsar-metadata | grep -v 'managed-ledger' | grep -v  'pulsar-client-admin' | grep -v  'pulsar-client-api' | grep -v 'pulsar-functions-api' | grep -v 'pulsar-presto-connector-original' | grep -v 'pulsar-presto-distribution' | grep -v 'pulsar-common' | grep -v 'pulsar-functions-proto' | grep -v 'pulsar-functions-utils' | grep -v 'pulsar-io-core' | grep -v 'pulsar-tran [...]
   if [ -n "$JARS" ]; then
     LICENSEPATH=$(tar -tf $TARBALL  | awk '/^[^\/]*\/lib\/presto\/LICENSE/')
     LICENSE=$(tar -O -xf $TARBALL "$LICENSEPATH")
diff --git a/tests/docker-images/latest-version-image/conf/presto/jvm.config b/tests/docker-images/latest-version-image/conf/presto/jvm.config
index 7511917b5b2..406283fefe6 100644
--- a/tests/docker-images/latest-version-image/conf/presto/jvm.config
+++ b/tests/docker-images/latest-version-image/conf/presto/jvm.config
@@ -27,4 +27,3 @@
 -XX:+ExitOnOutOfMemoryError
 -Dpresto-temporarily-allow-java8=true
 -Djdk.attach.allowAttachSelf=true
--javaagent:java-version-trim-agent.jar
\ No newline at end of file
diff --git a/tests/integration/src/test/resources/presto-coordinator-config.properties b/tests/integration/src/test/resources/presto-coordinator-config.properties
index 03a9ad1110d..8e554370b37 100644
--- a/tests/integration/src/test/resources/presto-coordinator-config.properties
+++ b/tests/integration/src/test/resources/presto-coordinator-config.properties
@@ -39,6 +39,4 @@ scheduler.http-client.idle-timeout=1m
 query.client.timeout=5m
 query.min-expire-age=30m
 
-presto.version=testversion
-
 node-scheduler.include-coordinator=true
diff --git a/tests/integration/src/test/resources/presto-follow-worker-config.properties b/tests/integration/src/test/resources/presto-follow-worker-config.properties
index be39b356b99..d9849fed71f 100644
--- a/tests/integration/src/test/resources/presto-follow-worker-config.properties
+++ b/tests/integration/src/test/resources/presto-follow-worker-config.properties
@@ -25,5 +25,3 @@ discovery.uri=http://presto-worker:8081
 
 query.client.timeout=5m
 query.min-expire-age=30m
-
-presto.version=testversion