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

virajjasani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/phoenix-adapters.git


The following commit(s) were added to refs/heads/main by this push:
     new 88652a1  PHOENIX-7901: Support JDK 11/17/21 in phoenix-adapters (#10)
88652a1 is described below

commit 88652a1749618fa0d1f5d5c8b3a7c6037a9895a0
Author: Jing Yu <[email protected]>
AuthorDate: Fri Jul 17 10:56:58 2026 -0700

    PHOENIX-7901: Support JDK 11/17/21 in phoenix-adapters (#10)
---
 .github/workflows/ci.yml                           | 19 +++--
 .../test/java/org/apache/phoenix/ddb/MiscIT.java   |  2 +-
 pom.xml                                            | 95 ++++++++++++++++++++--
 3 files changed, 104 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 56c938c..7939564 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,6 +9,13 @@ jobs:
   build-and-test:
     runs-on: ubuntu-latest
     
+    strategy:
+      matrix:
+        # PRs: JDK 8 only for fast feedback
+        # Push: JDK 8 + 21 to verify baseline and --add-opens flags
+        java: ${{ github.event_name == 'pull_request' && fromJSON('[8]') || 
fromJSON('[8, 21]') }}
+      fail-fast: false
+
     # Increase timeout for long-running test suites
     #timeout-minutes: 60
 
@@ -18,10 +25,10 @@ jobs:
       with:
         fetch-depth: 0
 
-    - name: Set up JDK 8
+    - name: Set up JDK ${{ matrix.java }}
       uses: actions/setup-java@v4
       with:
-        java-version: '8'
+        java-version: ${{ matrix.java }}
         distribution: 'temurin'
         cache: 'maven'
 
@@ -56,7 +63,7 @@ jobs:
       if: always()
       uses: actions/upload-artifact@v4
       with:
-        name: test-results
+        name: test-results-jdk${{ matrix.java }}
         path: |
           **/target/surefire-reports/*.xml
           **/target/surefire-reports/*.txt
@@ -68,7 +75,7 @@ jobs:
       if: failure()
       uses: actions/upload-artifact@v4
       with:
-        name: test-logs
+        name: test-logs-jdk${{ matrix.java }}
         path: |
           **/target/surefire-reports/*.txt
           **/target/failsafe-reports/*.txt
@@ -82,7 +89,7 @@ jobs:
         NODE_OPTIONS: '--max-old-space-size=12288'
       with:
         report_paths: '**/target/*-reports/TEST-*.xml'
-        check_name: Test Results
+        check_name: Test Results (JDK ${{ matrix.java }})
         fail_on_failure: true
         require_tests: true
 
@@ -90,7 +97,7 @@ jobs:
       if: success()
       uses: actions/upload-artifact@v4
       with:
-        name: build-artifacts
+        name: build-artifacts-jdk${{ matrix.java }}
         path: |
           phoenix-ddb-assembly/target/*.tar.gz
         retention-days: 5
diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MiscIT.java 
b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MiscIT.java
index 8b65381..67d20f5 100644
--- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MiscIT.java
+++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MiscIT.java
@@ -126,7 +126,7 @@ public class MiscIT {
                 phoenixDBStreamsClientV2);
     }
 
-    @Test(timeout = 600000)
+    @Test(timeout = 900000)
     public void testMixWorkflows4() throws Exception {
         Misc1Util.test3(dynamoDbClient, phoenixDBClientV2, 
dynamoDbStreamsClient,
                 phoenixDBStreamsClientV2);
diff --git a/pom.xml b/pom.xml
index d6b4315..61a2537 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,9 @@
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <java.version>1.8</java.version>
+    <compileSource>1.8</compileSource>
+    <maven.compiler.source>${compileSource}</maven.compiler.source>
+    <maven.compiler.target>${compileSource}</maven.compiler.target>
     <aws.sdk.version>2.30.22</aws.sdk.version>
     <phoenix.version>5.3.2</phoenix.version>
     <junit.version>4.13.1</junit.version>
@@ -59,6 +61,44 @@
     <numForkedIT>1</numForkedIT>
     <surefire.version>3.0.0-M6</surefire.version>
     <antlr4.version>4.9.3</antlr4.version>
+
+    <!-- JVM version dependent JVM options for running tests. Keep mostly in 
sync with HBase/Phoenix -->
+    <surefire.Xmx>2200m</surefire.Xmx>
+    <surefire.Xms>1000m</surefire.Xms>
+
+    <phoenix-surefire.argLine>-enableassertions -Xmx${surefire.Xmx} 
-Xms${surefire.Xms}
+      -Djava.security.egd=file:/dev/./urandom -Djava.net.preferIPv4Stack=true
+      -Djava.awt.headless=true 
-Djdk.net.URLClassPath.disableClassPathURLCheck=true
+      -Dorg.apache.hbase.thirdparty.io.netty.leakDetection.level=advanced
+      -Dio.netty.eventLoopThreads=3 -Duser.timezone="America/Los_Angeles"
+      -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./target/
+      
"-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"
+    </phoenix-surefire.argLine>
+    <phoenix-surefire.jdk8.tuning.flags>
+        -XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops 
-XX:+UseConcMarkSweepGC
+        -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly 
-XX:+CMSClassUnloadingEnabled
+        -XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68
+    </phoenix-surefire.jdk8.tuning.flags>
+    
<phoenix-surefire.jdk11.flags>-Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true
+      --add-modules jdk.unsupported
+      --add-opens java.base/java.nio=ALL-UNNAMED
+      --add-opens java.base/sun.nio.ch=ALL-UNNAMED
+      --add-opens java.base/java.lang=ALL-UNNAMED
+      --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
+      --add-opens java.base/java.lang.reflect=ALL-UNNAMED
+      --add-opens java.base/java.util=ALL-UNNAMED
+      --add-opens java.base/java.util.concurrent=ALL-UNNAMED
+      --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
+      --add-exports 
java.security.jgss/sun.security.krb5=ALL-UNNAMED</phoenix-surefire.jdk11.flags>
+    <phoenix-surefire.jdk11.tuning.flags/>
+    <phoenix-surefire.jdk17.flags>--add-opens 
java.base/jdk.internal.util.random=ALL-UNNAMED</phoenix-surefire.jdk17.flags>
+    <phoenix-surefire.jdk17.tuning.flags></phoenix-surefire.jdk17.tuning.flags>
+    <!-- Needed for SystemExitRule compatibility (not currently used) -->
+    
<phoenix-surefire.jdk21.flags>-Djava.security.manager=allow</phoenix-surefire.jdk21.flags>
+    <!-- Surefire argLine defaults for Linux + JDK8 -->
+    <argLine>${phoenix-surefire.argLine} ${phoenix-surefire.jdk8.tuning.flags} 
@{jacocoArgLine}</argLine>
+    <!-- Empty argument when code coverage is deactivated -->
+    <jacocoArgLine/>
   </properties>
 
   <build>
@@ -68,10 +108,6 @@
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>3.8.1</version>
-          <configuration>
-            <source>${java.version}</source>
-            <target>${java.version}</target>
-          </configuration>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
@@ -134,12 +170,61 @@
                 <goals>
                   <goal>prepare-agent</goal>
                 </goals>
+                <configuration>
+                  <propertyName>jacocoArgLine</propertyName>
+                </configuration>
               </execution>
             </executions>
           </plugin>
         </plugins>
       </build>
     </profile>
+    <profile>
+      <id>build-with-jdk8</id>
+      <activation>
+        <jdk>[1.8,11)</jdk>
+      </activation>
+    </profile>
+    <!-- See PHOENIX-7901 for Java 11+ support -->
+    <profile>
+      <id>build-with-jdk11</id>
+      <activation>
+        <jdk>[11,17)</jdk>
+      </activation>
+      <properties>
+        <argLine>${phoenix-surefire.jdk11.flags}
+          ${phoenix-surefire.jdk11.tuning.flags}
+          ${phoenix-surefire.argLine}
+          @{jacocoArgLine}</argLine>
+      </properties>
+    </profile>
+    <profile>
+      <id>build-with-jdk17</id>
+      <activation>
+        <jdk>[17,21)</jdk>
+      </activation>
+      <properties>
+        <argLine>${phoenix-surefire.jdk11.flags}
+          ${phoenix-surefire.jdk17.flags}
+          ${phoenix-surefire.jdk17.tuning.flags}
+          ${phoenix-surefire.argLine}
+          @{jacocoArgLine}</argLine>
+      </properties>
+    </profile>
+    <profile>
+      <id>build-with-jdk21</id>
+      <activation>
+        <jdk>[21,)</jdk>
+      </activation>
+      <properties>
+        <argLine>${phoenix-surefire.jdk11.flags}
+          ${phoenix-surefire.jdk17.flags}
+          ${phoenix-surefire.jdk21.flags}
+          ${phoenix-surefire.jdk17.tuning.flags}
+          ${phoenix-surefire.argLine}
+          @{jacocoArgLine}</argLine>
+      </properties>
+    </profile>
   </profiles>
 
   <dependencyManagement>

Reply via email to