Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/check-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '21'
distribution: 'adopt'

- name: use staged maven repo settings
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/cluster-test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ jobs:
env:
USE_STAGE: 'false' # Whether to include the stage repository.

strategy:
fail-fast: false
matrix:
JAVA_VERSION: ['11', '21']

steps:
- name: Install JDK 11
uses: actions/setup-java@v3
- name: Install JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'

- name: Cache Maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
java-version: '21'

- name: use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commons-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
strategy:
fail-fast: false
matrix:
JAVA_VERSION: ['11']
JAVA_VERSION: ['11', '21']

steps:
- name: Install JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'
Expand Down
43 changes: 31 additions & 12 deletions .github/workflows/pd-store-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ jobs:
runs-on: ubuntu-latest
env:
USE_STAGE: 'false'
strategy:
fail-fast: false
matrix:
JAVA_VERSION: ['11', '21']
steps:
- name: Install JDK 11
uses: actions/setup-java@v3
- name: Install JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'

- name: Cache Maven packages
Expand Down Expand Up @@ -67,11 +71,16 @@ jobs:
TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis
REPORT_DIR: target/site/jacoco

strategy:
fail-fast: false
matrix:
JAVA_VERSION: ['11', '21']

steps:
- name: Install JDK 11
uses: actions/setup-java@v3
- name: Install JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'

- name: Cache Maven packages
Expand Down Expand Up @@ -157,11 +166,16 @@ jobs:
TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis
REPORT_DIR: target/site/jacoco

strategy:
fail-fast: false
matrix:
JAVA_VERSION: ['11', '21']

steps:
- name: Install JDK 11
uses: actions/setup-java@v3
- name: Install JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'

- name: Cache Maven packages
Expand Down Expand Up @@ -261,11 +275,16 @@ jobs:
BACKEND: hstore
RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') || startsWith(github.base_ref, 'release-') }}

strategy:
fail-fast: false
matrix:
JAVA_VERSION: ['11', '21']

steps:
- name: Install JDK 11
uses: actions/setup-java@v3
- name: Install JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'

- name: Cache Maven packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/server-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fail-fast: false
matrix:
BACKEND: [ memory, rocksdb, hbase ]
JAVA_VERSION: [ '11' ]
JAVA_VERSION: [ '11', '21' ]

steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<scope>compile</scope>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down
5 changes: 5 additions & 0 deletions hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-clustertest-minicluster</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions hugegraph-pd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Dockerfile for HugeGraph PD
# 1st stage: build source code
FROM maven:3.9.0-eclipse-temurin-11 AS build
FROM maven:3.9.9-eclipse-temurin-21 AS build

WORKDIR /pkg

Expand All @@ -32,7 +32,7 @@ RUN --mount=type=cache,target=/root/.m2 \

# 2nd stage: runtime env
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
FROM eclipse-temurin:11-jre-jammy
FROM eclipse-temurin:21-jre-jammy

COPY --from=build /pkg/hugegraph-pd/apache-hugegraph-pd-*/ /hugegraph-pd/
LABEL maintainer="HugeGraph Docker Maintainers <dev@hugegraph.apache.org>"
Expand Down
4 changes: 2 additions & 2 deletions hugegraph-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Dockerfile for HugeGraph Server
# 1st stage: build source code
FROM maven:3.9.0-eclipse-temurin-11 AS build
FROM maven:3.9.9-eclipse-temurin-21 AS build

WORKDIR /pkg

Expand All @@ -32,7 +32,7 @@ RUN --mount=type=cache,target=/root/.m2 \

# 2nd stage: runtime env
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
FROM eclipse-temurin:11-jre-jammy
FROM eclipse-temurin:21-jre-jammy

COPY --from=build /pkg/hugegraph-server/apache-hugegraph-server-*/ /hugegraph-server/
LABEL maintainer="HugeGraph Docker Maintainers <dev@hugegraph.apache.org>"
Expand Down
4 changes: 2 additions & 2 deletions hugegraph-server/Dockerfile-hstore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Dockerfile for HugeGraph Server (hstore backend)
# 1st stage: build source code
FROM maven:3.9.0-eclipse-temurin-11 AS build
FROM maven:3.9.9-eclipse-temurin-21 AS build

WORKDIR /pkg

Expand All @@ -32,7 +32,7 @@ RUN --mount=type=cache,target=/root/.m2 \

# 2nd stage: runtime env
# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13
FROM eclipse-temurin:11-jre-jammy
FROM eclipse-temurin:21-jre-jammy

COPY --from=build /pkg/hugegraph-server/apache-hugegraph-server-*/ /hugegraph-server/
# remove hugegraph.properties and rename hstore.properties.template for default hstore backend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
import org.apache.tinkerpop.gremlin.driver.Cluster;
import org.apache.tinkerpop.gremlin.driver.Result;
import org.apache.tinkerpop.gremlin.driver.ResultSet;
import org.apache.tinkerpop.gremlin.driver.Tokens;
import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
import org.apache.tinkerpop.gremlin.util.message.RequestMessage;
import org.slf4j.Logger;

@ThreadSafe
Expand Down Expand Up @@ -90,9 +89,9 @@ public CypherModel submitQuery(String cypherQuery, @Nullable Map<String, String>
}

private RequestMessage createRequest(String cypherQuery) {
return RequestMessage.build(Tokens.OPS_EVAL)
return RequestMessage.build("eval")
.processor("cypher")
.add(Tokens.ARGS_GREMLIN, cypherQuery)
.addArg("gremlin", cypherQuery)
.create();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonList;
import static java.util.Optional.empty;
import static org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode.SERVER_ERROR;
import static org.apache.tinkerpop.gremlin.util.message.ResponseStatusCode.SERVER_ERROR;
import static org.opencypher.gremlin.translation.StatementOption.EXPLAIN;
import static org.slf4j.LoggerFactory.getLogger;

Expand All @@ -33,11 +33,10 @@
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;

import org.apache.tinkerpop.gremlin.driver.Tokens;
import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.util.message.RequestMessage;
import org.apache.tinkerpop.gremlin.util.message.ResponseMessage;
import org.apache.tinkerpop.gremlin.util.message.ResponseStatusCode;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
Expand Down Expand Up @@ -123,7 +122,7 @@ public Optional<ThrowingConsumer<Context>> selectOther(Context ctx) {

private void evalCypher(Context context) throws OpProcessorException {
Map<String, Object> args = context.getRequestMessage().getArgs();
String cypher = (String) args.get(Tokens.ARGS_GREMLIN);
String cypher = (String) args.get("gremlin");
logger.trace("Cypher: {}", cypher.replaceAll("\n", " "));

GraphTraversalSource gts = traversal(context);
Expand Down Expand Up @@ -183,8 +182,8 @@ private GraphTraversalSource traversal(Context context) throws OpProcessorExcept
RequestMessage msg = context.getRequestMessage();
GraphManager graphManager = context.getGraphManager();

Optional<Map<String, String>> aliasesOptional = msg.optionalArgs(Tokens.ARGS_ALIASES);
String gAlias = aliasesOptional.map(alias -> alias.get(Tokens.VAL_TRAVERSAL_SOURCE_ALIAS))
Optional<Map<String, String>> aliasesOptional = msg.optionalArgs("aliases");
String gAlias = aliasesOptional.map(alias -> alias.get("g"))
.orElse(null);

if (gAlias == null) {
Expand Down Expand Up @@ -220,8 +219,8 @@ private OpProcessorException opProcessorException(RequestMessage msg, String err
@Override
protected void handleIterator(Context context, Iterator traversal) {
RequestMessage msg = context.getRequestMessage();
final long timeout = msg.getArgs().containsKey(Tokens.ARGS_EVAL_TIMEOUT)
? ((Number) msg.getArgs().get(Tokens.ARGS_EVAL_TIMEOUT)).longValue()
final long timeout = msg.getArgs().containsKey("evaluationTimeout")
? ((Number) msg.getArgs().get("evaluationTimeout")).longValue()
: context.getSettings().evaluationTimeout;

FutureTask<Void> evalFuture = new FutureTask<>(() -> {
Expand Down Expand Up @@ -284,8 +283,8 @@ public void close() {

@SuppressWarnings("unchecked")
private Map<String, Object> getParameters(Map<String, Object> args) {
if (args.containsKey(Tokens.ARGS_BINDINGS)) {
return (Map<String, Object>) args.get(Tokens.ARGS_BINDINGS);
if (args.containsKey("bindings")) {
return (Map<String, Object>) args.get("bindings");
} else {
return new HashMap<>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.hugegraph.util.DateUtil;
import org.apache.hugegraph.util.E;
import org.apache.hugegraph.util.NumericUtil;
import org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
Expand All @@ -51,7 +52,7 @@ public enum ConditionType {
NOT
}

public enum RelationType implements BiPredicate<Object, Object> {
public enum RelationType implements PBiPredicate<Object, Object> {

EQ("==", RelationType::equals),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@

package org.apache.hugegraph.traversal.optimize;

import java.util.function.BiPredicate;

import org.apache.hugegraph.backend.query.Condition;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate;

public class ConditionP extends P<Object> {

private static final long serialVersionUID = 9094970577400072902L;

private ConditionP(final BiPredicate<Object, Object> predicate,
private ConditionP(final PBiPredicate<Object, Object> predicate,
Object value) {
super(predicate, value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateGlobalStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateLocalStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.CollectingBarrierStep;
Expand Down Expand Up @@ -81,8 +80,7 @@ public void apply(Traversal.Admin<?, ?> traversal) {
(step instanceof TraversalParent &&
TraversalHelper.anyStepRecursively(s -> {
return s instanceof SideEffectStep ||
s instanceof AggregateGlobalStep ||
s instanceof AggregateLocalStep;
s instanceof AggregateStep;
}, (TraversalParent) step))) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.slf4j.Logger;

public final class HugeGraphStep<S, E extends Element>
extends GraphStep<S, E> implements QueryHolder {
extends GraphStep<S, E> implements QueryHolder<S, E> {

private static final long serialVersionUID = -679873894532085972L;

Expand Down
Loading
Loading