This is an automated email from the ASF dual-hosted git repository.
tuhaihe pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git
The following commit(s) were added to refs/heads/main by this push:
new fdaad42e PXF3: require java 11 to run PXF (#146)
fdaad42e is described below
commit fdaad42eeb68fc8cad8f423736b49461f0beda30
Author: Nikolay Antonov <[email protected]>
AuthorDate: Fri Sep 11 07:12:08 2026 +0500
PXF3: require java 11 to run PXF (#146)
---
.github/workflows/pxf-ci.yml | 2 +-
CONTRIBUTING.md | 2 +-
README.md | 5 +---
automation/README.md | 29 ++++-------------------
automation/pom.xml | 6 ++---
ci/docker/pxf-cbdb-dev/common/script/run_tests.sh | 4 ++--
docs/administering/configuring/install_java.md | 20 +++++-----------
docs/administering/configuring/instcfg_pxf.md | 2 +-
docs/intro/intro_pxf.md | 2 +-
docs/troubleshooting/troubleshooting_pxf.md | 10 ++++++++
docs/upgrade/upgrade_pxf.md | 7 +++++-
package/cloudberry-pxf.spec | 4 ++--
server/build.gradle | 13 ++++++----
13 files changed, 48 insertions(+), 58 deletions(-)
diff --git a/.github/workflows/pxf-ci.yml b/.github/workflows/pxf-ci.yml
index 5da1a314..0aaf8bbe 100644
--- a/.github/workflows/pxf-ci.yml
+++ b/.github/workflows/pxf-ci.yml
@@ -308,7 +308,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- java: [ '8', '11', '17', '21' ]
+ java: [ '11', '17', '21' ]
fail-fast: false
steps:
- uses: actions/checkout@v4
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 02a2c06c..fc25528e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,7 +25,7 @@ you get started with the contribution.
Everyone who participates in Apache Cloudberry, either as a user or a
contributor, is obliged to follow our community [Code of
-Conduct](./CODE_OF_CONDUCT.md). Every violation against it will be reviewed
+Conduct](./CODE-OF-CONDUCT.md). Every violation against it will be reviewed
and investigated and will result in a response that is deemed necessary and
appropriate to the circumstances. The moderator team is obligated to maintain
confidentiality regarding the reporter of an incident.
diff --git a/README.md b/README.md
index 0be14cd2..5d6aeafb 100755
--- a/README.md
+++ b/README.md
@@ -69,12 +69,9 @@ To build PXF, you must have:
source /usr/local/cloudberry-db/cloudberry-env.sh # For Cloudberry 2.1+
```
-3. A full JDK -- 1.8, 11, 17, or 21 -- to compile/run. A JRE is not enough, as
the
+3. A full JDK -- 11, 17, or 21 -- to compile/run. A JRE is not enough, as the
server module needs `javac`.
- > [!NOTE]
- > Support for JDK 1.8 will be removed in PXF 3.0. Use JDK 11 or later for
new setups.
-
Export your `JAVA_HOME`:
```
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 # Debian/Ubuntu
diff --git a/automation/README.md b/automation/README.md
index 8300d079..e03f066e 100755
--- a/automation/README.md
+++ b/automation/README.md
@@ -10,7 +10,7 @@ In order to run PXF automation tests the following are needed
1. Running Hadoop cluster
2. Running GPDB
-3. JRE 1.8
+3. JDK 11+
## Build & Test
@@ -246,9 +246,9 @@ You can read more about TestNG here
<http://testng.org/doc/index.md>
@Test(groups = { "features" })
public void readDelimitedTextUsingTextFormat() throws Exception {
// set plugins and delimiter
-
exTable.setFragmenter("com.pivotal.pxf.plugins.hdfs.HdfsDataFragmenter");
-
exTable.setAccessor("com.pivotal.pxf.plugins.hdfs.LineBreakAccessor");
-
exTable.setResolver("com.pivotal.pxf.plugins.hdfs.StringPassResolver");
+
exTable.setFragmenter("org.apache.cloudberry.pxf.plugins.hdfs.HdfsDataFragmenter");
+
exTable.setAccessor("org.apache.cloudberry.pxf.plugins.hdfs.LineBreakAccessor");
+
exTable.setResolver("org.apache.cloudberry.pxf.plugins.hdfs.StringPassResolver");
exTable.setDelimiter(",");
// create external table
gpdb.createTableAndVerify(exTable);
@@ -258,31 +258,12 @@ You can read more about TestNG here
<http://testng.org/doc/index.md>
runSqlTest("features/hdfs/readable/text/small_data");
}
- /**
- * Verify deprecated "LineReaderAccessor" gives required results.
- *
- * @throws Exception
- */
- @Test(groups = "features")
- public void deprecatedLineReaderAccessor() throws Exception {
- // set plugins and delimiter
-
exTable.setFragmenter("com.pivotal.pxf.plugins.hdfs.HdfsDataFragmenter");
-
exTable.setAccessor("com.pivotal.pxf.plugins.hdfs.LineReaderAccessor");
-
exTable.setResolver("com.pivotal.pxf.plugins.hdfs.StringPassResolver");
- exTable.setDelimiter(",");
- // create external table
- gpdb.createTableAndVerify(exTable);
- // write data to HDFS
- hdfs.writeTableToFile(hdfsFilePath, dataTable, ",");
- // verify results
- runSqlTest("features/hdfs/readable/text/small_data");
- }
}
```
## Run reports and logs
-Automation logs will be generated into `automation-logs`` directory and will
be divided into directories according to run Java classes.
+Automation logs are generated in `automation_logs/`, grouped by test class.
In every `<class>` directory, there will be files according to the following
format: `<time-stamp>_<ran method name>.log`
<img src="images/72680961.png" class="confluence-embedded-image
confluence-content-image-border" width="454" height="598" />
diff --git a/automation/pom.xml b/automation/pom.xml
index 1be23e50..e318ec6a 100644
--- a/automation/pom.xml
+++ b/automation/pom.xml
@@ -14,7 +14,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <java.version>1.8</java.version>
+ <java.version>11</java.version>
<gphd.home>${GPHD_ROOT}</gphd.home>
<pxf.lib>${user.home}/automation_tmp_lib</pxf.lib>
<hdp.hadoop.version>2.10.2</hdp.hadoop.version>
@@ -51,8 +51,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
</configuration>
</plugin>
<plugin>
diff --git a/ci/docker/pxf-cbdb-dev/common/script/run_tests.sh
b/ci/docker/pxf-cbdb-dev/common/script/run_tests.sh
index 41e492fc..49b454ac 100755
--- a/ci/docker/pxf-cbdb-dev/common/script/run_tests.sh
+++ b/ci/docker/pxf-cbdb-dev/common/script/run_tests.sh
@@ -43,8 +43,8 @@ export PXF_TEST_KEEP_DATA=${PXF_TEST_KEEP_DATA:-true}
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-admin}
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-password}
-# Hadoop/Hive/HBase env
-export JAVA_HOME="${JAVA_HADOOP}"
+# Automation is built and run with Java 11; Hadoop daemons use JAVA_HADOOP.
+export JAVA_HOME="${JAVA_BUILD}"
export PATH="$JAVA_HOME/bin:$PATH"
source "${GPHD_ROOT}/bin/gphd-env.sh"
diff --git a/docs/administering/configuring/install_java.md
b/docs/administering/configuring/install_java.md
index 0e55cb6b..17e45c55 100644
--- a/docs/administering/configuring/install_java.md
+++ b/docs/administering/configuring/install_java.md
@@ -4,12 +4,12 @@ description: Installing Java for the PXF service.
sidebar_position: 4
---
-PXF is a Java service. It requires a Java 8 or Java 11 installation on each
Apache Cloudberry host.
+PXF is a Java service. It requires a Java 11, 17 or 21 installation on each
Apache Cloudberry host.
## Prerequisites
-Ensure that you have access to, or superuser permissions to install, Java 8 or
Java 11 on each Apache Cloudberry host.
+Ensure that you have access to, or superuser permissions to install, Java on
each Apache Cloudberry host.
## Procedure
@@ -27,7 +27,7 @@ Perform the following procedure to install Java on the
coordinator host, standby
gpadmin@coordinator$ rpm -qa | grep java
```
-3. If the system does not include a Java version 8 or 11 installation, install
one of these Java versions on the coordinator host, standby coordinator host,
and on each Apache Cloudberry segment host.
+3. If the system does not include a Java installation, install it on the
coordinator host, standby coordinator host, and on each Apache Cloudberry
segment host.
1. Create a text file that lists your Apache Cloudberry standby
coordinator host and segment hosts, one host name per line. For example, a file
named `gphostfile` may include:
@@ -38,22 +38,14 @@ Perform the following procedure to install Java on the
coordinator host, standby
seghost2
seghost3
```
- 2. Install the Java package on each host. For example, to install Java
version 8:
+ 2. Install the Java package on each host. For example:
``` shell
- gpadmin@coordinator$ gpssh -e -v -f gphostfile sudo yum -y install
java-1.8.0-openjdk-1.8.0*
+ gpadmin@coordinator$ gpssh -e -v -f gphostfile sudo yum -y install
java-11-openjdk
```
-4. Identify the Java 8 or 11 `$JAVA_HOME` setting for PXF. For example:
+4. Identify the Java `$JAVA_HOME` setting for PXF. For example:
- If you installed Java 8:
-
- ``` shell
- JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.x86_64/jre
- ```
-
- If you installed Java 11:
-
``` shell
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.4.11-0.el7_6.x86_64
```
diff --git a/docs/administering/configuring/instcfg_pxf.md
b/docs/administering/configuring/instcfg_pxf.md
index c6d9da02..e5b2563d 100644
--- a/docs/administering/configuring/instcfg_pxf.md
+++ b/docs/administering/configuring/instcfg_pxf.md
@@ -10,7 +10,7 @@ PXF provides connectors to Hadoop, Hive, HBase, object
stores, network file syst
To configure PXF, you must:
-1. Install Java 8 or 11 on each Apache Cloudberry host as described in
[Installing Java for PXF](./install_java.md). If your `JAVA_HOME` is different
from `/usr/java/default`, you must inform PXF of the `$JAVA_HOME` setting by
specifying its value in the `pxf-env.sh` [configuration
file](./config_files.md).
+1. Install Java 11, 17 or 21 on each Apache Cloudberry host as described in
[Installing Java for PXF](./install_java.md). If your `JAVA_HOME` is different
from `/usr/java/default`, you must inform PXF of the `$JAVA_HOME` setting by
specifying its value in the `pxf-env.sh` [configuration
file](./config_files.md).
- Edit the `$PXF_BASE/conf/pxf-env.sh` file on the Apache Cloudberry
coordinator host.
``` shell
diff --git a/docs/intro/intro_pxf.md b/docs/intro/intro_pxf.md
index e576c3d0..1f769382 100644
--- a/docs/intro/intro_pxf.md
+++ b/docs/intro/intro_pxf.md
@@ -21,7 +21,7 @@ PXF is compatible with these operating system platforms and
Apache Cloudberry ve
### Java
-PXF supports Java 8 and Java 11.
+PXF supports Java 11, 17 and 21.
### Hadoop
diff --git a/docs/troubleshooting/troubleshooting_pxf.md
b/docs/troubleshooting/troubleshooting_pxf.md
index be272ed1..4871399e 100644
--- a/docs/troubleshooting/troubleshooting_pxf.md
+++ b/docs/troubleshooting/troubleshooting_pxf.md
@@ -44,6 +44,16 @@ Most PXF error messages include a `HINT` that you can use to
resolve the error,
Refer to the [Logging](../administering/advanced-config/cfg_logging.md) topic
for more information about logging levels, configuration, and the `pxf-app.out`
and `pxf-service.log` log files.
+## Java Version Errors After an Upgrade
+
+The current PXF classes target Java 11 (class-file version 55). Starting them
+with Java 8 can fail with `UnsupportedClassVersionError`, mentioning version
+`55.0` and a runtime that only recognizes versions up to `52.0`.
+
+Check `JAVA_HOME` in `$PXF_BASE/conf/pxf-env.sh` on every Apache Cloudberry
host.
+Install/select Java 11, synchronize the PXF configuration, and restart the
service.
+See [Installing Java for PXF](../administering/configuring/install_java.md).
+
## Addressing PXF JDBC Connector Time Zone Errors
diff --git a/docs/upgrade/upgrade_pxf.md b/docs/upgrade/upgrade_pxf.md
index 46fc72df..e3383d2e 100644
--- a/docs/upgrade/upgrade_pxf.md
+++ b/docs/upgrade/upgrade_pxf.md
@@ -41,9 +41,14 @@ Perform this procedure before you upgrade to a new version
of PXF:
gpadmin@coordinator$ cp -avi /usr/local/cloudberry-pxf pxf_base.bak
```
-
## Step 2: Install the New PXF
+PXF requires **Java 11, 17, or 21**. Before installing the new PXF version,
+install one of these Java versions on every Apache Cloudberry host and set
+`JAVA_HOME` in `$PXF_BASE/conf/pxf-env.sh` to its installation directory.
+Verify the configured executable with `"$JAVA_HOME/bin/java" -version`. See
+[Installing Java for PXF](../administering/configuring/install_java.md).
+
Install the new version of PXF, and identify and note the new PXF version
number.
diff --git a/package/cloudberry-pxf.spec b/package/cloudberry-pxf.spec
index 9631675b..025d4d53 100644
--- a/package/cloudberry-pxf.spec
+++ b/package/cloudberry-pxf.spec
@@ -47,9 +47,9 @@ Requires: procps-ng
# installing on Cloudberry node, so inherit Cloudberry's dependencies
# implicitly
-# Weak dependencies either OpenJDK 8 or 11
-Suggests: java-1.8.0-openjdk
+# Weak dependencies: OpenJDK 11 or 17
Suggests: java-11-openjdk
+Suggests: java-17-openjdk
%description
Apache Cloudberry PXF (Platform Extension Framework) is an advanced data
diff --git a/server/build.gradle b/server/build.gradle
index 08e5b116..463e03d2 100644
--- a/server/build.gradle
+++ b/server/build.gradle
@@ -50,8 +50,8 @@ allprojects {
idea {
project {
- jdkName = "1.8"
- languageLevel = "8"
+ jdkName = "11"
+ languageLevel = "11"
vcs = "Git"
}
}
@@ -64,8 +64,13 @@ configure(javaProjects) {
group = 'org.apache.cloudberry.pxf'
version = "${version}"
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
+ sourceCompatibility = JavaVersion.VERSION_11
+ targetCompatibility = JavaVersion.VERSION_11
+
+ tasks.withType(JavaCompile).configureEach {
+ // Keep the Java 11 API/bytecode baseline when building with newer
JDKs.
+ options.release = 11
+ }
ext['log4j2.version'] = '2.25.4'
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]