Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 47 additions & 33 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: mvn clean install -DskipTests -Dci --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
Expand All @@ -36,36 +36,50 @@ jobs:
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: mvn clean install -pl $EXCLUDE_MODULES -Dci --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
java-jdk11:
name: mvn clean install - jdk11
run: mvn clean install -pl $EXCLUDE_MODULES -Dci --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dcoverage
- name: Upload to Codecov
uses: codecov/codecov-action@v7
with:
directory: ./gremlin-tools/gremlin-coverage/target/site
java-jdk21:
name: mvn clean install - jdk21
timeout-minutes: 45
needs: smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'
- name: Build with Maven
run: mvn clean install -pl $EXCLUDE_MODULES -Dci --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dcoverage
- name: Upload to Codecov
uses: codecov/codecov-action@v7
run: mvn clean install -pl $EXCLUDE_MODULES -Dci --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
java-jdk25:
name: mvn clean install - jdk25
timeout-minutes: 45
needs: smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
directory: ./gremlin-tools/gremlin-coverage/target/site
java-version: '25'
distribution: 'temurin'
- name: Build with Maven
run: mvn clean install -pl $EXCLUDE_MODULES -Dci --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
gremlin-server-default:
name: gremlin-server default
timeout-minutes: 45
needs: smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: |
Expand All @@ -78,10 +92,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Generate Gremlin Server Base
working-directory: .
Expand Down Expand Up @@ -114,10 +128,10 @@ jobs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v7
# - name: Set up JDK 11
# - name: Set up JDK 17
# uses: actions/setup-java@v5
# with:
# java-version: '11'
# java-version: '17'
# distribution: 'temurin'
# - name: Build with Maven
# run: |
Expand All @@ -130,10 +144,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: |
Expand All @@ -149,10 +163,10 @@ jobs:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build with Maven Windows
if: runner.os == 'Windows'
Expand All @@ -173,10 +187,10 @@ jobs:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build with Maven Windows
if: runner.os == 'Windows'
Expand All @@ -194,10 +208,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: |
Expand All @@ -211,10 +225,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build with Maven
run: |
Expand All @@ -231,10 +245,10 @@ jobs:
node-version: [ '22', '24', '26' ]
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Get Cached Server Base Image
uses: actions/cache@v6
Expand Down Expand Up @@ -265,10 +279,10 @@ jobs:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v7
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
Expand All @@ -287,10 +301,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK11
- name: Set up JDK17
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Set up .NET 8.0.x
uses: actions/setup-dotnet@v5
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
[[release-4-0-0]]
=== TinkerPop 4.0.0 (Release Date: NOT OFFICIALLY RELEASED YET)

* Raised the minimum Java version to 17 for building and running *(breaking)*.
* Enabled building and running with Java 21 and Java 25.
* Bumped Groovy to 4.0.32, Hadoop to 3.4.3, Spark to 4.1.2 (Scala 2.13), and Netty to 4.2.7 to support Java 25.
* Standardized connection options across all GLVs (Java, Python, .NET, Go, JavaScript) per the TinkerPop 4.x GLV proposal; see the upgrade docs for the full per-driver table. *(breaking)*
** Aligned option names across drivers: `maxConnections` (128), `connectTimeoutMillis` (5000), `readTimeoutMillis` (off), `idleTimeoutMillis` (180000), `keepAliveTimeMillis` (30000), `compression` (on/`deflate`), `batchSize` (64), `bulkResults` (false), `maxResponseHeaderBytes`, `proxy`, and `ssl`. Timeouts use a millisecond-suffixed canonical name with an idiomatic duration companion (Java `Duration`, Go `time.Duration`, .NET `TimeSpan`, Python seconds); JavaScript uses milliseconds only.
** Java: renamed `maxConnectionPoolSize`/`connectionSetupTimeoutMillis`/`idleConnectionTimeoutMillis`/`resultIterationBatchSize` and `RequestOptions.addG`->`traversalSource`; removed `maxResponseContentLength` (responses now stream); added `readTimeoutMillis`, `keepAliveTimeMillis`, `maxResponseHeaderBytes`, `proxy`, `url(String)`, `ssl(SslContext)`. *(breaking)*
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN apt-get install apt-transport-https gnupg ca-certificates
RUN sh -c 'echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list'
RUN apt-get update

RUN apt-get install -y openjdk-11-jdk gawk git maven openssh-server subversion zip
RUN apt-get install -y openjdk-17-jdk gawk git maven openssh-server subversion zip
RUN apt-get install -y --force-yes dotnet-sdk-8.0 mono-devel

ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -43,7 +43,7 @@ RUN python3 -m pip install --upgrade pip
RUN pip install virtualenv
RUN pip install virtualenvwrapper --no-deps

RUN rm -rf /var/lib/apt/lists/* /var/cache/openjdk-11-jdk
RUN rm -rf /var/lib/apt/lists/* /var/cache/openjdk-17-jdk

RUN sed -i 's@PermitRootLogin without-password@PermitRootLogin yes@' /etc/ssh/sshd_config
RUN sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuuid.so@g' /etc/pam.d/sshd
Expand Down
9 changes: 5 additions & 4 deletions docs/src/dev/developer/development-environment.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ image:conspiracy.png[]
[[system-configuration]]
== System Configuration

At a minimum, development of TinkerPop requires link:https://openjdk.java.net/projects/jdk/11/[Java 11] or
link:https://openjdk.org/projects/jdk/17/[Java 17]. Note, however, that there are some issues with deep reflection
At a minimum, development of TinkerPop requires link:https://openjdk.org/projects/jdk/17/[Java 17]; builds and tests
also run on link:https://openjdk.org/projects/jdk/21/[Java 21] and link:https://openjdk.org/projects/jdk/25/[Java 25].
Note, however, that there are some issues with deep reflection
so there are `--add-opens` JVM options included in the pom files to enable this to work. Maven (requiring a minimum of
link:https://maven.apache.org/download.cgi[Maven 3.5.3+]) is used as the common build system, which even
controls the builds of non-JVM link:https://tinkerpop.apache.org/docs/x.y.z/reference/#gremlin-drivers-variants[GLVs]
Expand All @@ -47,7 +48,7 @@ system. You will need to install both link:https://docs.docker.com/engine/instal
link:https://docs.docker.com/compose/install/[Docker Compose], which are included in
link:https://docs.docker.com/desktop/[Docker Desktop].

IMPORTANT: Use Java 11 for documentation generation with `bin/process-docs.sh` and for other build features outside
IMPORTANT: Use Java 17 for documentation generation with `bin/process-docs.sh` and for other build features outside
of the basic `mvn clean install` sort of function.

IMPORTANT: For those who intend to offer a contribution, building with a minimal configuration may not be sufficient
Expand Down Expand Up @@ -124,7 +125,7 @@ The core of the documentation generation process is an link:https://asciidoctor.
Gremlin Console subprocess, and renders the console output as tabbed HTML. The orchestration script
`bin/process-docs.sh` wraps this and acts as the entrypoint: it validates the Gremlin Console and Gremlin Server
distributions, installs the required plugins into the console, starts a Gremlin Server (for the `:remote` examples) and
a Gephi mock, then invokes Maven to run the extension. Javadocs should be built using Java 11.
a Gephi mock, then invokes Maven to run the extension. Javadocs should be built using Java 17.

Before generating documentation, build the build all of the dependencies that the process consumes:

Expand Down
1 change: 1 addition & 0 deletions docs/src/reference/gremlin-variants.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ The following table outlines recommended runtime versions by the release in whic
|3.6.0 | Java 8, 11
|3.7.0 | Java 8, 11, 17
|3.8.0 | Java 11, 17
|4.0.0 | Java 17, 21, 25
|===

[[gremlin-java-connecting]]
Expand Down
14 changes: 14 additions & 0 deletions docs/src/upgrade/release-4.x.x.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ These change runtime behavior on upgrade even if you do not change your configur

See: link:https://lists.apache.org/thread/yqtr2wnb1kq2pqqq4002cz511q5o0bkg[[DISCUSS] Standardizing GLV connection options in TinkerPop 4].

==== Java 17 Required; Java 21 and 25 Supported

TinkerPop 4.0 raises the minimum Java version from 11 to 17 for both building and running, and adds support for running
on Java 21 and Java 25, so that every LTS release from the new minimum upward is covered by TinkerPop's automated
tests. *(breaking)* Supporting Java 25 required upgrading Groovy to 4.0.32 (whose bundled ASM can parse Java 25
bytecode) and Hadoop to 3.4.3 (which moved off the `Subject.getSubject()` API that was removed along with the Security
Manager). Spark was upgraded to 4.1.x, built on Scala 2.13 — the first Spark line that supports Java 25. Because Spark 4
requires Java 17 as its minimum, and `spark-gremlin` is part of the build, the project-wide minimum is now Java 17.
Netty was upgraded to 4.2.x as required by Spark 4.

As with the earlier JDK 17 support, some libraries still rely on deep reflection (most notably the Kryo serialization
library used with OLAP), so it may be necessary to `--add-opens` or `--add-exports` certain modules at runtime. The set
of options used by TinkerPop's own tests is unchanged.

==== Declarative Pattern Matching

Gremlin has always offered both imperative and declarative styles to writing graph queries. While the imperative style
Expand Down
6 changes: 3 additions & 3 deletions gremlin-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ limitations under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>8</release>
<source>8</source>
<target>8</target>
<release>17</release>
<source>17</source>
<target>17</target>
<compilerArgs>
<arg>-parameters</arg>
<arg>-proc:none</arg>
Expand Down
2 changes: 1 addition & 1 deletion gremlin-console/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ARG GREMLIN_CONSOLE_DIR

RUN apk add --no-cache --update \
bash \
openjdk11-jdk
openjdk17-jdk

COPY src/main/docker/docker-entrypoint.sh /
COPY ${GREMLIN_CONSOLE_DIR} /opt/gremlin-console
Expand Down
4 changes: 2 additions & 2 deletions gremlin-console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,12 @@ limitations under the License.
<target>
<exec executable="docker" failonerror="true">
<!-- This build command relies on Docker's caching mechanism to reduce the amount of times it is run. -->
<arg line="build -t gremlin-console-test:py3.10jre11 ./src/test/python/docker"/>
<arg line="build -t gremlin-console-test:py3.10jre17 ./src/test/python/docker"/>
</exec>
<exec executable="docker" failonerror="true">
<arg line="run --rm --mount type=bind,src=${project.basedir}/src/test/python,dst=/console_app
--mount type=bind,src=${project.basedir}/target/apache-tinkerpop-gremlin-console-${project.version}-standalone,dst=/console_app/gremlin-console
gremlin-console-test:py3.10jre11"/>
gremlin-console-test:py3.10jre17"/>
</exec>
</target>
</configuration>
Expand Down
5 changes: 3 additions & 2 deletions gremlin-console/src/main/bin/gremlin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ if [ -n "$SCRIPT_DEBUG" ]; then
set -x
fi

# Detect JDK version and add specific flags for JDK 17
# Detect the JDK major version and add specific flags for JDK 17 and newer
JAVA_VERSION=$($JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$JAVA_VERSION" == 17* ]]; then
JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | awk -F. '{if ($1 == 1) print $2; else print $1}')
if [[ "$JAVA_MAJOR_VERSION" -ge 17 ]]; then
JVM_OPTS+=( "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED" )
JVM_OPTS+=( "--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED" )
fi
Expand Down
2 changes: 1 addition & 1 deletion gremlin-console/src/test/python/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FROM python:3.10-bullseye

LABEL maintainer="dev@tinkerpop.apache.org"

RUN apt-get update && apt-get install -y --no-install-recommends openjdk-11-jre && apt-get install dos2unix
RUN apt-get update && apt-get install -y --no-install-recommends openjdk-17-jre && apt-get install dos2unix

WORKDIR /console_app
CMD dos2unix ./gremlin-console/bin/gremlin.sh && python3 setup.py build && python3 setup.py test; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private LambdaRestrictionStrategy() {
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
for (final Step<?, ?> step : traversal.getSteps()) {
if ((step instanceof LambdaHolder || step instanceof ComparatorHolder) && step.toString().contains("lambda"))
if ((step instanceof LambdaHolder || step instanceof ComparatorHolder) && step.toString().toLowerCase().contains("lambda"))
throw new VerificationException("The provided traversal contains a lambda step: " + step, traversal);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ else if (o instanceof Map)
}

private static boolean hasLambda(final String objectString) {
return objectString.contains("$Lambda$") || // JAVA (org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraphPlayTest$$Lambda$1/1711574013@61a52fb)
return objectString.contains("$Lambda$") || // JAVA <21 (org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraphPlayTest$$Lambda$1/1711574013@61a52fb)
objectString.contains("$$Lambda/") || // JAVA 21+ (org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraphPlayTest$$Lambda/0x00007fc001151000@61a52fb)
objectString.contains("$_run_closure") || // GROOVY (groovysh_evaluate$_run_closure1@db44aa2)
objectString.contains("<lambda>"); // PYTHON (<function <lambda> at 0x10dfaec80>)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,15 @@ public void shouldImportWildcardFields() throws Exception {
.fieldsImports(Collections.singletonList(Math.class.getCanonicalName() + "#*")).create();

final DefaultImportCustomizer customizer = (DefaultImportCustomizer) module.getCustomizers().get()[0];
assertThat(customizer.getFieldImports(), is(new HashSet<>(
Arrays.asList(Math.class.getField("PI"), Math.class.getField("E")))));
// Math.TAU was added in Java 19
final HashSet<Field> expectedFields = new HashSet<>(Arrays.asList(
Math.class.getField("PI"), Math.class.getField("E")));
try {
expectedFields.add(Math.class.getField("TAU"));
} catch (NoSuchFieldException ignored) {
// TAU not available in Java < 19
}
assertThat(customizer.getFieldImports(), is(expectedFields));
}

@Test
Expand Down
Loading
Loading