This is an automated email from the ASF dual-hosted git repository.
cbqiao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/geaflow.git
The following commit(s) were added to refs/heads/master by this push:
new ce2ebf8a Jdk11 ci support (#618)
ce2ebf8a is described below
commit ce2ebf8aff41c96636bb80465675d62540253146
Author: Loognqiang <[email protected]>
AuthorDate: Mon Sep 15 18:03:40 2025 +0800
Jdk11 ci support (#618)
* [ISSUE-601] add jdk11 ci yml
* [ISSUE-601] solve the problem of failing the timezone ut caused by
timezone
* [ISSUE-601] add concurrency group
* [ISSUE-601] support jdk11 ci run & compatible with jdk8
* [ISSUE-601] disable dsl-runtime ut run as dependency on hive connector
* [ISSUE-601] break build&test into two stages
* [ISSUE-601] revert build&test into one stage
* [ISSUE-601] fix module name
* [ISSUE-601] fix script
* [ISSUE-601] fix script
* [ISSUE-601] maven surefire version add in parent pom
---
.github/workflows/ci-jdk11.yml | 68 +++++++++++++++++
.github/workflows/ci.yml | 28 ++++++-
geaflow-console/pom.xml | 9 +--
geaflow-kubernetes-operator/pom.xml | 4 +-
.../geaflow/common/binary/BinaryOperations.java | 5 +-
.../apache/geaflow/common/utils/IdGenerator.java | 1 +
.../apache/geaflow/common/utils/ProcessUtil.java | 2 +-
.../geaflow/common/utils/RetryCommandTest.java | 6 +-
.../geaflow/collector/AbstractCollector.java | 6 +-
.../geaflow-engine/geaflow-rpc-proto/pom.xml | 10 ++-
.../network/protocol/CompositeFileRegion.java | 1 +
.../core/protocol/AbstractExecutableCommand.java | 4 -
geaflow/geaflow-dsl/geaflow-dsl-runtime/pom.xml | 4 +-
.../dsl/runtime/engine/GeaFlowRuntimeGraph.java | 2 +-
.../GeaFlowStaticVCAggTraversalFunction.java | 2 +-
.../runtime/traversal/path/AbstractTreePath.java | 2 +-
geaflow/geaflow-examples/pom.xml | 7 +-
.../example/stream/StreamWordFlatMapPipeline.java | 2 +-
.../example/stream/StreamWordPrintPipeline.java | 2 +-
.../example/window/WindowKeyAggPipeline.java | 2 +-
.../example/window/WindowStreamKeyAggPipeline.java | 2 +-
.../window/WindowStreamWordCountPipeline.java | 2 +-
.../example/window/WindowWordCountPipeline.java | 2 +-
.../infer/exchange/DataQueueInputStream.java | 3 +-
.../infer/exchange/DataQueueOutputStream.java | 3 +-
.../geaflow/infer/exchange/MemoryMapper.java | 5 +-
.../apache/geaflow/infer/exchange/UnSafeUtils.java | 13 ++--
.../org/apache/geaflow/memory/DirectMemory.java | 3 +-
.../main/java/org/apache/geaflow/memory/Page.java | 3 +-
.../apache/geaflow/memory/PlatformDependent.java | 17 ++---
.../apache/geaflow/memory/cleaner/CleanerTest.java | 2 +-
.../geaflow-store/geaflow-store-memory/pom.xml | 5 ++
geaflow/geaflow-state/geaflow-state-common/pom.xml | 10 +--
geaflow/geaflow-state/geaflow-state-impl/pom.xml | 5 ++
geaflow/geaflow-utils/pom.xml | 5 ++
.../apache/geaflow/utils/keygroup/KeyGroup.java | 2 +-
.../org/apache/geaflow/utils/math/MathUtil.java | 9 +--
geaflow/pom.xml | 9 ++-
pom.xml | 87 +++++++++++++++++++---
tools/checkstyle.xml | 19 ++---
40 files changed, 274 insertions(+), 99 deletions(-)
diff --git a/.github/workflows/ci-jdk11.yml b/.github/workflows/ci-jdk11.yml
new file mode 100644
index 00000000..94c10311
--- /dev/null
+++ b/.github/workflows/ci-jdk11.yml
@@ -0,0 +1,68 @@
+################################################################################
+# 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.
+################################################################################
+
+name: Java CI with Maven On JDK 11
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+
+env:
+ JAVA_TOOL_OPTIONS: -Xmx4g
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Print available memory
+ run: free -m
+
+ - name: Set time zone
+ run: sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
+
+ - name: Set up JDK 11
+ uses: actions/setup-java@v4
+ with:
+ java-version: '11'
+ distribution: 'temurin'
+
+ - name: Setup Protoc
+ uses: arduino/setup-protoc@v2
+ with:
+ version: "21.7"
+
+ # Current hive connector is incompatible with jdk11, implement 4.0.0+
hive version in later.
+ - name: Build and Test On JDK 11
+ run: |
+
test_modules="!geaflow/geaflow-dsl/geaflow-dsl-connector/geaflow-dsl-connector-hive,"
+ test_modules+="!geaflow/geaflow-dsl/geaflow-dsl-runtime,"
+
test_modules+="!geaflow/geaflow-analytics-service/geaflow-analytics-service-common,"
+
test_modules+="!geaflow/geaflow-analytics-service/geaflow-analytics-service-client,"
+
test_modules+="!geaflow/geaflow-analytics-service/geaflow-analytics-service-server,"
+ test_modules+="!geaflow/geaflow-examples,"
+ test_modules+="!geaflow/geaflow-deploy/geaflow-assembly,"
+ test_modules+="!geaflow-mcp"
+ mvn -B -e clean test -Pjdk11 -pl "${test_modules}"
-Duser.timezone=Asia/Shanghai -Dlog4j.configuration="log4j.rootLogger=WARN,
stdout"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index fd78fbf6..2567476e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,22 @@
-name: Java CI with Maven
+################################################################################
+# 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.
+################################################################################
+name: Java CI with Maven On JDK 8
on:
push:
@@ -9,6 +27,10 @@ on:
env:
JAVA_TOOL_OPTIONS: -Xmx4g
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event_name }}-${{
github.event.number || github.run_id }}
+ cancel-in-progress: true
+
jobs:
build:
@@ -35,5 +57,5 @@ jobs:
with:
version: "21.7"
- - name: Build and Test
- run: mvn -B -e clean test -Duser.timezone=Asia/Shanghai
-Dlog4j.configuration="log4j.rootLogger=WARN, stdout"
+ - name: Build and Test On JDK 8
+ run: mvn -B -e clean test -Pjdk8 -Duser.timezone=Asia/Shanghai
-Dlog4j.configuration="log4j.rootLogger=WARN, stdout"
diff --git a/geaflow-console/pom.xml b/geaflow-console/pom.xml
index 47dd8679..a9cdfe00 100644
--- a/geaflow-console/pom.xml
+++ b/geaflow-console/pom.xml
@@ -46,7 +46,6 @@
</modules>
<properties>
- <java.version>8</java.version>
<spring.version>2.7.10</spring.version>
<mybatis.plus.version>3.5.1</mybatis.plus.version>
<fastjson.version>2.0.29</fastjson.version>
@@ -243,10 +242,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.3</version>
+ <version>3.11.0</version>
<configuration>
- <source>${java.version}</source>
- <target>${java.version}</target>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.source}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
@@ -275,7 +274,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>2.0.2</version>
+ <version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
diff --git a/geaflow-kubernetes-operator/pom.xml
b/geaflow-kubernetes-operator/pom.xml
index 44d2b72f..e6175edb 100644
--- a/geaflow-kubernetes-operator/pom.xml
+++ b/geaflow-kubernetes-operator/pom.xml
@@ -195,7 +195,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.3</version>
+ <version>3.11.0</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
@@ -235,7 +235,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>2.0.2</version>
+ <version>3.2.1</version>
<executions>
<execution>
<goals>
diff --git
a/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/binary/BinaryOperations.java
b/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/binary/BinaryOperations.java
index 1fc79171..4359006d 100644
---
a/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/binary/BinaryOperations.java
+++
b/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/binary/BinaryOperations.java
@@ -21,11 +21,10 @@ package org.apache.geaflow.common.binary;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import sun.misc.Unsafe;
public class BinaryOperations {
- private static final Unsafe UNSAFE;
+ private static final sun.misc.Unsafe UNSAFE;
public static final int BOOLEAN_ARRAY_OFFSET;
@@ -49,7 +48,7 @@ public class BinaryOperations {
static {
sun.misc.Unsafe unsafe;
try {
- Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
+ Field unsafeField =
sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
unsafeField.setAccessible(true);
unsafe = (sun.misc.Unsafe) unsafeField.get(null);
} catch (Throwable cause) {
diff --git
a/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/utils/IdGenerator.java
b/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/utils/IdGenerator.java
index 8908c495..154723c1 100644
---
a/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/utils/IdGenerator.java
+++
b/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/utils/IdGenerator.java
@@ -51,6 +51,7 @@ public class IdGenerator {
private long sequence = 0L;
/**
+ * Id generator.
* @param containerId (0~65534).
*/
public IdGenerator(long containerId) {
diff --git
a/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/utils/ProcessUtil.java
b/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/utils/ProcessUtil.java
index 30768332..d2148664 100644
---
a/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/utils/ProcessUtil.java
+++
b/geaflow/geaflow-common/src/main/java/org/apache/geaflow/common/utils/ProcessUtil.java
@@ -104,7 +104,7 @@ public class ProcessUtil {
public static synchronized int getProcessPid(Process p) {
int pid = -1;
try {
- if (p.getClass().getName().equals("java.lang.UNIXProcess")) {
+ if (ReflectionUtil.JAVA_VERSION >= 9 ||
p.getClass().getName().equals("java.lang.UNIXProcess")) {
Field f = p.getClass().getDeclaredField("pid");
f.setAccessible(true);
pid = f.getInt(p);
diff --git
a/geaflow/geaflow-common/src/test/java/org/apache/geaflow/common/utils/RetryCommandTest.java
b/geaflow/geaflow-common/src/test/java/org/apache/geaflow/common/utils/RetryCommandTest.java
index 14b7dd83..0f5dd45c 100644
---
a/geaflow/geaflow-common/src/test/java/org/apache/geaflow/common/utils/RetryCommandTest.java
+++
b/geaflow/geaflow-common/src/test/java/org/apache/geaflow/common/utils/RetryCommandTest.java
@@ -20,11 +20,15 @@
package org.apache.geaflow.common.utils;
import org.apache.geaflow.common.exception.GeaflowRuntimeException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.Test;
public class RetryCommandTest {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(RetryCommandTest.class);
+
@Test(expectedExceptions = GeaflowRuntimeException.class)
public void testFail() {
final int time = 0;
@@ -34,7 +38,7 @@ public class RetryCommandTest {
@Test
public void testRun() {
Object result = RetryCommand.run(() -> {
- System.out.println("hello");
+ LOGGER.info("hello");
return "null";
}, 1, 100);
Assert.assertEquals(result, "null");
diff --git
a/geaflow/geaflow-core/geaflow-core-common/src/main/java/org/apache/geaflow/collector/AbstractCollector.java
b/geaflow/geaflow-core/geaflow-core-common/src/main/java/org/apache/geaflow/collector/AbstractCollector.java
index 7e591329..88c06598 100644
---
a/geaflow/geaflow-core/geaflow-core-common/src/main/java/org/apache/geaflow/collector/AbstractCollector.java
+++
b/geaflow/geaflow-core/geaflow-core-common/src/main/java/org/apache/geaflow/collector/AbstractCollector.java
@@ -44,7 +44,9 @@ public abstract class AbstractCollector {
return id;
}
- public void finish() {}
+ public void finish() {
+ }
- public void close() {}
+ public void close() {
+ }
}
diff --git a/geaflow/geaflow-core/geaflow-engine/geaflow-rpc-proto/pom.xml
b/geaflow/geaflow-core/geaflow-engine/geaflow-rpc-proto/pom.xml
index a9dcc5ca..de1b495f 100644
--- a/geaflow/geaflow-core/geaflow-engine/geaflow-rpc-proto/pom.xml
+++ b/geaflow/geaflow-core/geaflow-engine/geaflow-rpc-proto/pom.xml
@@ -45,6 +45,12 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <version>${javax-api.version}</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
<build>
@@ -60,8 +66,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>8</source>
- <target>8</target>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
</configuration>
</plugin>
<!-- <plugin>-->
diff --git
a/geaflow/geaflow-core/geaflow-engine/geaflow-shuffle/src/main/java/org/apache/geaflow/shuffle/network/protocol/CompositeFileRegion.java
b/geaflow/geaflow-core/geaflow-engine/geaflow-shuffle/src/main/java/org/apache/geaflow/shuffle/network/protocol/CompositeFileRegion.java
index d53b2cf8..cec53db4 100644
---
a/geaflow/geaflow-core/geaflow-engine/geaflow-shuffle/src/main/java/org/apache/geaflow/shuffle/network/protocol/CompositeFileRegion.java
+++
b/geaflow/geaflow-core/geaflow-engine/geaflow-shuffle/src/main/java/org/apache/geaflow/shuffle/network/protocol/CompositeFileRegion.java
@@ -44,6 +44,7 @@ public class CompositeFileRegion extends AbstractFileRegion {
private static final int NIO_BUFFER_LIMIT = 256 * 1024;
/**
+ * Composite File Region.
* @param header the message header.
* @param body the message body. Must be either a {@link ByteBuf}
or a {@link FileRegion}.
* @param contentSize the length of the message body and header, in bytes.
diff --git
a/geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/main/java/org/apache/geaflow/runtime/core/protocol/AbstractExecutableCommand.java
b/geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/main/java/org/apache/geaflow/runtime/core/protocol/AbstractExecutableCommand.java
index bbdc91bd..c175246a 100644
---
a/geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/main/java/org/apache/geaflow/runtime/core/protocol/AbstractExecutableCommand.java
+++
b/geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/main/java/org/apache/geaflow/runtime/core/protocol/AbstractExecutableCommand.java
@@ -101,10 +101,6 @@ public abstract class AbstractExecutableCommand implements
IExecutableCommand {
/**
* Finish compute and tell scheduler finish.
- *
- * @param cycleId
- * @param windowId
- * @param eventType
*/
protected <T> void sendDoneEvent(String driverId, EventType
sourceEventType, T result, boolean sendMetrics) {
AbstractWorkerContext workerContext = (AbstractWorkerContext)
this.context;
diff --git a/geaflow/geaflow-dsl/geaflow-dsl-runtime/pom.xml
b/geaflow/geaflow-dsl/geaflow-dsl-runtime/pom.xml
index 09f8ba71..7bde5bf8 100644
--- a/geaflow/geaflow-dsl/geaflow-dsl-runtime/pom.xml
+++ b/geaflow/geaflow-dsl/geaflow-dsl-runtime/pom.xml
@@ -154,7 +154,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>3.0.0-M3</version>
+ <version>${maven-surefire.version}</version>
<configuration>
<!-- Optimize memory usage -->
<argLine>-Xmx512m -XX:MaxMetaspaceSize=256m -XX:+UseG1GC
-XX:MaxGCPauseMillis=200 -Djava.awt.headless=true</argLine>
@@ -190,7 +190,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>3.0.0-M3</version>
+ <version>${maven-surefire.version}</version>
<configuration>
<argLine>-Xmx1024m -XX:MaxMetaspaceSize=512m
-XX:+UseG1GC</argLine>
<forkCount>1</forkCount>
diff --git
a/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/engine/GeaFlowRuntimeGraph.java
b/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/engine/GeaFlowRuntimeGraph.java
index 11411997..f8e52c30 100644
---
a/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/engine/GeaFlowRuntimeGraph.java
+++
b/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/engine/GeaFlowRuntimeGraph.java
@@ -290,7 +290,7 @@ public class GeaFlowRuntimeGraph implements RuntimeGraph {
} else if (constantStartIds.size() > 0) { // request with constant ids.
return ((PGraphTraversal<Object, ITreePath>)
getDynamicVCTraversal(isAggTraversal, dynamicGraph,
executeDagGroup, maxTraversal, false, parallelism,
enableIncrTraversal)).start(
- new ArrayList<>(constantStartIds));
+ new ArrayList<>(constantStartIds));
} else { // dynamic traversal all
boolean enableTraversalAllSplit = queryContext.getGlobalConf()
.getBoolean(DSLConfigKeys.GEAFLOW_DSL_TRAVERSAL_SPLIT_ENABLE);
diff --git
a/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/engine/GeaFlowStaticVCAggTraversalFunction.java
b/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/engine/GeaFlowStaticVCAggTraversalFunction.java
index 4bab2790..62ec2236 100644
---
a/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/engine/GeaFlowStaticVCAggTraversalFunction.java
+++
b/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/engine/GeaFlowStaticVCAggTraversalFunction.java
@@ -45,7 +45,7 @@ public class GeaFlowStaticVCAggTraversalFunction implements
public void open(
VertexCentricTraversalFuncContext<Object, Row, Row, MessageBox,
ITreePath> vertexCentricFuncContext) {
commonFunction.open(this.traversalRuntimeContext =
- new
GeaFlowStaticTraversalRuntimeContext(vertexCentricFuncContext));
+ new
GeaFlowStaticTraversalRuntimeContext(vertexCentricFuncContext));
}
@Override
diff --git
a/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/traversal/path/AbstractTreePath.java
b/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/traversal/path/AbstractTreePath.java
index 239870e0..8e7e739f 100644
---
a/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/traversal/path/AbstractTreePath.java
+++
b/geaflow/geaflow-dsl/geaflow-dsl-runtime/src/main/java/org/apache/geaflow/dsl/runtime/traversal/path/AbstractTreePath.java
@@ -295,7 +295,6 @@ public abstract class AbstractTreePath implements ITreePath
{
if (ArrayUtil.isEmpty(pathIndices)) {
return new ArrayList<>();
}
- Set<Path> selectPaths = new HashSet<>();
int minIndex = pathIndices[0];
int maxIndex = pathIndices[0];
for (int index : pathIndices) {
@@ -317,6 +316,7 @@ public abstract class AbstractTreePath implements ITreePath
{
newIndices.add(index - minIndex);
}
+ Set<Path> selectPaths = new HashSet<>();
walkTree(paths -> {
for (Path path : paths) {
selectPaths.add(path.subPath(newIndices));
diff --git a/geaflow/geaflow-examples/pom.xml b/geaflow/geaflow-examples/pom.xml
index 758f2872..a4988a2a 100644
--- a/geaflow/geaflow-examples/pom.xml
+++ b/geaflow/geaflow-examples/pom.xml
@@ -30,11 +30,6 @@
<artifactId>geaflow-examples</artifactId>
- <properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
- </properties>
-
<dependencies>
<dependency>
<groupId>commons-io</groupId>
@@ -91,7 +86,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>3.0.0-M3</version>
+ <version>${maven-surefire.version}</version>
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
diff --git
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/stream/StreamWordFlatMapPipeline.java
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/stream/StreamWordFlatMapPipeline.java
index 24d1b06f..eb0f6142 100644
---
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/stream/StreamWordFlatMapPipeline.java
+++
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/stream/StreamWordFlatMapPipeline.java
@@ -48,11 +48,11 @@ public class StreamWordFlatMapPipeline implements
Serializable {
public static final String SPLIT = ",";
public IPipelineResult submit(Environment environment) {
- Pipeline pipeline = PipelineFactory.buildPipeline(environment);
Map<String, String> config = new HashMap<>();
config.put(FileSink.OUTPUT_DIR, RESULT_FILE_PATH);
ResultValidator.cleanResult(RESULT_FILE_PATH);
environment.getEnvironmentContext().withConfig(config);
+ Pipeline pipeline = PipelineFactory.buildPipeline(environment);
pipeline.submit(new PipelineTask() {
@Override
public void execute(IPipelineTaskContext pipelineTaskCxt) {
diff --git
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/stream/StreamWordPrintPipeline.java
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/stream/StreamWordPrintPipeline.java
index ae505664..414842a1 100644
---
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/stream/StreamWordPrintPipeline.java
+++
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/stream/StreamWordPrintPipeline.java
@@ -46,11 +46,11 @@ public class StreamWordPrintPipeline implements
Serializable {
public static final String REF_FILE_PATH = "data/reference/wordprint";
public IPipelineResult submit(Environment environment) {
- Pipeline pipeline = PipelineFactory.buildPipeline(environment);
Map<String, String> config = new HashMap<>();
config.put(FileSink.OUTPUT_DIR, RESULT_FILE_PATH);
ResultValidator.cleanResult(RESULT_FILE_PATH);
environment.getEnvironmentContext().withConfig(config);
+ Pipeline pipeline = PipelineFactory.buildPipeline(environment);
pipeline.submit(new PipelineTask() {
@Override
public void execute(IPipelineTaskContext pipelineTaskCxt) {
diff --git
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowKeyAggPipeline.java
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowKeyAggPipeline.java
index 53a6e919..366363ac 100644
---
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowKeyAggPipeline.java
+++
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowKeyAggPipeline.java
@@ -52,11 +52,11 @@ public class WindowKeyAggPipeline implements Serializable {
public static final String SPLIT = ",";
public IPipelineResult submit(Environment environment) {
- Pipeline pipeline = PipelineFactory.buildPipeline(environment);
Configuration envConfig =
environment.getEnvironmentContext().getConfig();
envConfig.getConfigMap().put(FileSink.OUTPUT_DIR, RESULT_FILE_PATH);
envConfig.getConfigMap().put(FrameworkConfigKeys.INC_STREAM_MATERIALIZE_DISABLE.getKey(),
Boolean.TRUE.toString());
ResultValidator.cleanResult(RESULT_FILE_PATH);
+ Pipeline pipeline = PipelineFactory.buildPipeline(environment);
pipeline.submit(new PipelineTask() {
@Override
public void execute(IPipelineTaskContext pipelineTaskCxt) {
diff --git
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowStreamKeyAggPipeline.java
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowStreamKeyAggPipeline.java
index 2a2b2c2b..c46bbf97 100644
---
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowStreamKeyAggPipeline.java
+++
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowStreamKeyAggPipeline.java
@@ -52,11 +52,11 @@ public class WindowStreamKeyAggPipeline implements
Serializable {
public static final String SPLIT = ",";
public IPipelineResult submit(Environment environment) {
- Pipeline pipeline = PipelineFactory.buildPipeline(environment);
Configuration envConfig =
environment.getEnvironmentContext().getConfig();
envConfig.getConfigMap().put(FileSink.OUTPUT_DIR, RESULT_FILE_PATH);
envConfig.getConfigMap().put(FrameworkConfigKeys.INC_STREAM_MATERIALIZE_DISABLE.getKey(),
Boolean.TRUE.toString());
ResultValidator.cleanResult(RESULT_FILE_PATH);
+ Pipeline pipeline = PipelineFactory.buildPipeline(environment);
pipeline.submit(new PipelineTask() {
@Override
public void execute(IPipelineTaskContext pipelineTaskCxt) {
diff --git
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowStreamWordCountPipeline.java
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowStreamWordCountPipeline.java
index e0428ab7..8d4c1b8f 100644
---
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowStreamWordCountPipeline.java
+++
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowStreamWordCountPipeline.java
@@ -53,11 +53,11 @@ public class WindowStreamWordCountPipeline implements
Serializable {
public static final String REF_FILE_PATH = "data/reference/count2";
public IPipelineResult submit(Environment environment) {
- Pipeline pipeline = PipelineFactory.buildPipeline(environment);
Configuration envConfig =
environment.getEnvironmentContext().getConfig();
envConfig.getConfigMap().put(FileSink.OUTPUT_DIR, RESULT_FILE_PATH);
envConfig.getConfigMap().put(FrameworkConfigKeys.INC_STREAM_MATERIALIZE_DISABLE.getKey(),
Boolean.TRUE.toString());
ResultValidator.cleanResult(RESULT_FILE_PATH);
+ Pipeline pipeline = PipelineFactory.buildPipeline(environment);
pipeline.submit(new PipelineTask() {
@Override
public void execute(IPipelineTaskContext pipelineTaskCxt) {
diff --git
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowWordCountPipeline.java
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowWordCountPipeline.java
index 90114cc3..8d73a616 100644
---
a/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowWordCountPipeline.java
+++
b/geaflow/geaflow-examples/src/main/java/org/apache/geaflow/example/window/WindowWordCountPipeline.java
@@ -54,11 +54,11 @@ public class WindowWordCountPipeline implements
Serializable {
public static final String REF_FILE_PATH = "data/reference/count1";
public IPipelineResult submit(Environment environment) {
- Pipeline pipeline = PipelineFactory.buildPipeline(environment);
Configuration envConfig =
environment.getEnvironmentContext().getConfig();
envConfig.getConfigMap().put(FileSink.OUTPUT_DIR, RESULT_FILE_PATH);
envConfig.getConfigMap().put(FrameworkConfigKeys.INC_STREAM_MATERIALIZE_DISABLE.getKey(),
Boolean.TRUE.toString());
ResultValidator.cleanResult(RESULT_FILE_PATH);
+ Pipeline pipeline = PipelineFactory.buildPipeline(environment);
pipeline.submit(new PipelineTask() {
@Override
public void execute(IPipelineTaskContext pipelineTaskCxt) {
diff --git
a/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/DataQueueInputStream.java
b/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/DataQueueInputStream.java
index 06142fae..e6497003 100644
---
a/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/DataQueueInputStream.java
+++
b/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/DataQueueInputStream.java
@@ -28,7 +28,6 @@ import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import sun.misc.Unsafe;
public class DataQueueInputStream extends InputStream {
@@ -117,7 +116,7 @@ public class DataQueueInputStream extends InputStream {
}
int readableNum = Math.min(remainByteNum, length);
long left = this.initialAddress + (inputPointer & this.queueMask);
- int right = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset;
+ int right = sun.misc.Unsafe.ARRAY_BYTE_BASE_OFFSET + offset;
UnSafeUtils.UNSAFE.copyMemory(null, left, buffer, right, readableNum);
dataExchangeQueue.setInputPointer(inputPointer + readableNum);
return readableNum;
diff --git
a/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/DataQueueOutputStream.java
b/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/DataQueueOutputStream.java
index 85cb26f3..b3114ab5 100644
---
a/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/DataQueueOutputStream.java
+++
b/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/DataQueueOutputStream.java
@@ -26,7 +26,6 @@ import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.apache.geaflow.common.exception.GeaflowRuntimeException;
-import sun.misc.Unsafe;
public class DataQueueOutputStream extends OutputStream {
private static final int BUFFER_SIZE = 10 * 1024;
@@ -74,7 +73,7 @@ public class DataQueueOutputStream extends OutputStream {
long nextPointIndex = getNextPointIndex(outputPointer,
queueCapacity);
int remainNum = (int) (nextPointIndex - outputPointer);
int bytesToWrite = Math.min(size - currentOutputNum, remainNum);
- int left = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset +
currentOutputNum;
+ int left = sun.misc.Unsafe.ARRAY_BYTE_BASE_OFFSET + offset +
currentOutputNum;
long right = dataExchangeQueue.getInitialQueueAddress() +
(outputPointer & queueMask);
UnSafeUtils.UNSAFE.copyMemory(buffer, left, null, right,
bytesToWrite);
diff --git
a/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/MemoryMapper.java
b/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/MemoryMapper.java
index 5a4c64c3..dca358be 100644
---
a/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/MemoryMapper.java
+++
b/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/MemoryMapper.java
@@ -26,7 +26,6 @@ import java.nio.channels.FileChannel;
import org.apache.geaflow.common.exception.GeaflowRuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import sun.nio.ch.FileChannelImpl;
public class MemoryMapper implements Closeable {
@@ -42,8 +41,8 @@ public class MemoryMapper implements Closeable {
static {
try {
- MEMORY_MAP_METHOD = getMethod(FileChannelImpl.class, MAP_0,
int.class, long.class, long.class);
- MEMORY_UN_MAP_METHOD = getMethod(FileChannelImpl.class, UNMAP_0,
long.class, long.class);
+ MEMORY_MAP_METHOD = getMethod(sun.nio.ch.FileChannelImpl.class,
MAP_0, int.class, long.class, long.class);
+ MEMORY_UN_MAP_METHOD = getMethod(sun.nio.ch.FileChannelImpl.class,
UNMAP_0, long.class, long.class);
} catch (Exception e) {
throw new GeaflowRuntimeException(e);
}
diff --git
a/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/UnSafeUtils.java
b/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/UnSafeUtils.java
index 4d71237b..07d72fa0 100644
---
a/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/UnSafeUtils.java
+++
b/geaflow/geaflow-infer/src/main/java/org/apache/geaflow/infer/exchange/UnSafeUtils.java
@@ -24,21 +24,20 @@ import java.lang.reflect.Field;
import org.apache.geaflow.common.exception.GeaflowRuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import sun.misc.Unsafe;
public class UnSafeUtils {
private static final Logger LOGGER =
LoggerFactory.getLogger(UnSafeUtils.class);
private static final String THE_UNSAFE = "theUnsafe";
- public static final Unsafe UNSAFE;
+ public static final sun.misc.Unsafe UNSAFE;
static {
- Unsafe instance;
+ sun.misc.Unsafe instance;
try {
- Field field = Unsafe.class.getDeclaredField(THE_UNSAFE);
+ Field field = sun.misc.Unsafe.class.getDeclaredField(THE_UNSAFE);
field.setAccessible(true);
- instance = (Unsafe) field.get(null);
+ instance = (sun.misc.Unsafe) field.get(null);
} catch (Exception e) {
LOGGER.error("get unsafe field failed", e);
instance = initDeclaredConstructor();
@@ -46,9 +45,9 @@ public class UnSafeUtils {
UNSAFE = instance;
}
- private static Unsafe initDeclaredConstructor() {
+ private static sun.misc.Unsafe initDeclaredConstructor() {
try {
- Constructor<Unsafe> c = Unsafe.class.getDeclaredConstructor();
+ Constructor<sun.misc.Unsafe> c =
sun.misc.Unsafe.class.getDeclaredConstructor();
c.setAccessible(true);
return c.newInstance();
} catch (Exception e) {
diff --git
a/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/DirectMemory.java
b/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/DirectMemory.java
index b443ad08..f99235de 100644
---
a/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/DirectMemory.java
+++
b/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/DirectMemory.java
@@ -33,7 +33,6 @@ import org.apache.geaflow.memory.cleaner.CleanerJava9;
import org.apache.geaflow.memory.exception.GeaflowOutOfMemoryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import sun.misc.Unsafe;
/**
* This class is an adaptation of Netty's io.netty.util.internal.DirectMemory.
@@ -284,7 +283,7 @@ public final class DirectMemory {
return USE_DIRECT_BUFFER_NO_CLEANER;
}
- public static Unsafe unsafe() {
+ public static sun.misc.Unsafe unsafe() {
return PlatformDependent.UNSAFE;
}
diff --git
a/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/Page.java
b/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/Page.java
index ed8f84bb..28dab990 100644
--- a/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/Page.java
+++ b/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/Page.java
@@ -104,8 +104,9 @@ public class Page<T> implements PageMetric {
}
/**
+ * Free page.
* @return {@code true} if this subpage is in use.
- * {@code false} if this subpage is not used by its chunk and thus it's OK
to be released.
+ * {@code false} if this subpage is not used by its chunk and thus
it's OK to be released.
*/
boolean free(Page<T> head, int bitmapIdx) {
if (elemSize == 0) {
diff --git
a/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/PlatformDependent.java
b/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/PlatformDependent.java
index bc5525cd..1b6f3718 100644
---
a/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/PlatformDependent.java
+++
b/geaflow/geaflow-memory/src/main/java/org/apache/geaflow/memory/PlatformDependent.java
@@ -33,7 +33,6 @@ import java.security.PrivilegedAction;
import org.apache.geaflow.common.utils.ReflectionUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import sun.misc.Unsafe;
/**
* This class is an adaptation of Netty's
io.netty.util.internal.PlatformDependent.
@@ -42,7 +41,7 @@ public final class PlatformDependent implements Serializable {
private static final Logger LOGGER =
LoggerFactory.getLogger(PlatformDependent.class);
- static final Unsafe UNSAFE;
+ static final sun.misc.Unsafe UNSAFE;
// constants borrowed from murmur3
static final int HASH_CODE_ASCII_SEED = 0xc2b2ae35;
static final int HASH_CODE_C1 = 0xcc9e2d51;
@@ -52,7 +51,7 @@ public final class PlatformDependent implements Serializable {
private static final Constructor<?> DIRECT_BUFFER_CONSTRUCTOR;
private static final Throwable UNSAFE_UNAVAILABILITY_CAUSE;
/**
- * Limits the number of bytes to copy per {@link Unsafe#copyMemory(long,
long, long)} to allow
+ * Limits the number of bytes to copy per {@link
sun.misc.Unsafe#copyMemory(long, long, long)} to allow
* safepoint polling
* during a large copy.
*/
@@ -62,7 +61,7 @@ public final class PlatformDependent implements Serializable {
final ByteBuffer direct;
Field addressField = null;
Throwable unsafeUnavailabilityCause = null;
- Unsafe unsafe;
+ sun.misc.Unsafe unsafe;
direct = ByteBuffer.allocateDirect(1);
@@ -70,7 +69,7 @@ public final class PlatformDependent implements Serializable {
final Object maybeUnsafe = AccessController
.doPrivileged((PrivilegedAction<Object>) () -> {
try {
- final Field unsafeField =
Unsafe.class.getDeclaredField("theUnsafe");
+ final Field unsafeField =
sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
// We always want to try using Unsafe as the access still
works on java9
// as well and
// we need it for out native-transports and many
optimizations.
@@ -95,7 +94,7 @@ public final class PlatformDependent implements Serializable {
unsafe = null;
unsafeUnavailabilityCause = (Throwable) maybeUnsafe;
} else {
- unsafe = (Unsafe) maybeUnsafe;
+ unsafe = (sun.misc.Unsafe) maybeUnsafe;
}
// ensure the unsafe supports all necessary methods to work around the
mistake in the
@@ -103,7 +102,7 @@ public final class PlatformDependent implements
Serializable {
// https://github.com/netty/netty/issues/1061
// http://www.mail-archive.com/[email protected]/msg00698.html
if (unsafe != null) {
- final Unsafe finalUnsafe = unsafe;
+ final sun.misc.Unsafe finalUnsafe = unsafe;
final Object maybeException = AccessController
.doPrivileged((PrivilegedAction<Object>) () -> {
try {
@@ -123,7 +122,7 @@ public final class PlatformDependent implements
Serializable {
}
if (unsafe != null) {
- final Unsafe finalUnsafe = unsafe;
+ final sun.misc.Unsafe finalUnsafe = unsafe;
// attempt to access field Buffer#address
final Object maybeAddressField = AccessController
@@ -185,7 +184,7 @@ public final class PlatformDependent implements
Serializable {
try {
final Constructor<?> constructor =
direct.getClass()
.getDeclaredConstructor(long.class, int.class);
- Throwable cause =
ReflectionUtil.trySetAccessible(constructor, true);
+ Throwable cause =
ReflectionUtil.trySetAccessible(constructor, false);
if (cause != null) {
return cause;
}
diff --git
a/geaflow/geaflow-memory/src/test/java/org/apache/geaflow/memory/cleaner/CleanerTest.java
b/geaflow/geaflow-memory/src/test/java/org/apache/geaflow/memory/cleaner/CleanerTest.java
index 0547fb64..2a1179a2 100644
---
a/geaflow/geaflow-memory/src/test/java/org/apache/geaflow/memory/cleaner/CleanerTest.java
+++
b/geaflow/geaflow-memory/src/test/java/org/apache/geaflow/memory/cleaner/CleanerTest.java
@@ -36,7 +36,7 @@ public class CleanerTest {
CleanerJava6 cleanerJava = new CleanerJava6();
cleanerJava.freeDirectBuffer(bf);
} else {
- Assert.assertFalse(CleanerJava6.isSupported());
+ Assert.assertTrue(CleanerJava6.isSupported());
Assert.assertTrue(CleanerJava9.isSupported());
CleanerJava9 cleanerJava = new CleanerJava9();
diff --git a/geaflow/geaflow-plugins/geaflow-store/geaflow-store-memory/pom.xml
b/geaflow/geaflow-plugins/geaflow-store/geaflow-store-memory/pom.xml
index e17d6b85..82eeff1a 100644
--- a/geaflow/geaflow-plugins/geaflow-store/geaflow-store-memory/pom.xml
+++ b/geaflow/geaflow-plugins/geaflow-store/geaflow-store-memory/pom.xml
@@ -47,5 +47,10 @@
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/geaflow/geaflow-state/geaflow-state-common/pom.xml
b/geaflow/geaflow-state/geaflow-state-common/pom.xml
index a3a398c7..e233112f 100644
--- a/geaflow/geaflow-state/geaflow-state-common/pom.xml
+++ b/geaflow/geaflow-state/geaflow-state-common/pom.xml
@@ -30,11 +30,6 @@
<artifactId>geaflow-state-common</artifactId>
- <properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
- </properties>
-
<packaging>jar</packaging>
<dependencies>
@@ -70,6 +65,11 @@
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/geaflow/geaflow-state/geaflow-state-impl/pom.xml
b/geaflow/geaflow-state/geaflow-state-impl/pom.xml
index 84cd836c..898351ca 100644
--- a/geaflow/geaflow-state/geaflow-state-impl/pom.xml
+++ b/geaflow/geaflow-state/geaflow-state-impl/pom.xml
@@ -63,6 +63,11 @@
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <scope>test</scope>
+ </dependency>
<!-- test end -->
</dependencies>
diff --git a/geaflow/geaflow-utils/pom.xml b/geaflow/geaflow-utils/pom.xml
index 2b0c9a1b..f7241a25 100644
--- a/geaflow/geaflow-utils/pom.xml
+++ b/geaflow/geaflow-utils/pom.xml
@@ -68,6 +68,11 @@
<artifactId>jmh-generator-annprocess</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
diff --git
a/geaflow/geaflow-utils/src/main/java/org/apache/geaflow/utils/keygroup/KeyGroup.java
b/geaflow/geaflow-utils/src/main/java/org/apache/geaflow/utils/keygroup/KeyGroup.java
index 1ce551ef..e7da0c64 100644
---
a/geaflow/geaflow-utils/src/main/java/org/apache/geaflow/utils/keygroup/KeyGroup.java
+++
b/geaflow/geaflow-utils/src/main/java/org/apache/geaflow/utils/keygroup/KeyGroup.java
@@ -43,7 +43,7 @@ public class KeyGroup implements Serializable {
}
/**
- * @return The number of key-groups in the range.
+ * Get the number of key-groups in the range.
*/
public int getNumberOfKeyGroups() {
return 1 + endKeyGroup - startKeyGroup;
diff --git
a/geaflow/geaflow-utils/src/main/java/org/apache/geaflow/utils/math/MathUtil.java
b/geaflow/geaflow-utils/src/main/java/org/apache/geaflow/utils/math/MathUtil.java
index d9473d4e..aef6f3d1 100644
---
a/geaflow/geaflow-utils/src/main/java/org/apache/geaflow/utils/math/MathUtil.java
+++
b/geaflow/geaflow-utils/src/main/java/org/apache/geaflow/utils/math/MathUtil.java
@@ -246,12 +246,11 @@ public class MathUtil {
* valid range.
* @param value from which to search for next power of 2
* @return The next power of 2 or the value itself if it is a power of 2.
- * <p/>
* Special cases for return values are as follows:
- * <ul>
- * <li>{@code <= 0} -> 1</li>
- * <li>{@code >= 2^30} -> 2^30</li>
- * </ul>
+ * <ul>
+ * <li>{@code <= 0} -> 1</li>
+ * <li>{@code >= 2^30} -> 2^30</li>
+ * </ul>
*/
public static int safeFindNextPositivePowerOfTwo(final int value) {
return value <= 0 ? 1 : value >= 0x40000000 ? 0x40000000 :
findNextPositivePowerOfTwo(value);
diff --git a/geaflow/pom.xml b/geaflow/pom.xml
index c1735018..029b43fb 100644
--- a/geaflow/pom.xml
+++ b/geaflow/pom.xml
@@ -61,7 +61,7 @@
<protobuf.version>3.8.0</protobuf.version>
<hadoop.version>2.7.4</hadoop.version>
<zookeeper.version>3.5.6</zookeeper.version>
- <netty.version>4.1.30.Final</netty.version>
+ <netty.version>4.1.68.Final</netty.version>
<pangu.dfs.version>1.0.4.2ant02-82e3b7d</pangu.dfs.version>
<kotlin.version>1.5.10</kotlin.version>
<oss.sdk.version>2.2.0</oss.sdk.version>
@@ -89,6 +89,7 @@
<s3-transfer-manager.version>2.21.30</s3-transfer-manager.version>
<aws-crt.version>0.28.10</aws-crt.version>
<org.jetbrains.annotations>13.0</org.jetbrains.annotations>
+ <javax-api.version>1.3.2</javax-api.version>
</properties>
<modules>
@@ -418,6 +419,12 @@
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>javax.annotation-api</artifactId>
+ <version>${javax-api.version}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.curator</groupId>
diff --git a/pom.xml b/pom.xml
index 8427f2ca..fae4b82f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,36 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.version>3.6.3</maven.version>
<mysql.version>8.0.30</mysql.version>
+ <maven-surefire.version>3.0.0-M7</maven-surefire.version>
+
+ <!-- By default, JDK 8 is used -->
+ <jdk.version>1.8</jdk.version>
+ <maven.compiler.source>${jdk.version}</maven.compiler.source>
+ <maven.compiler.target>${jdk.version}</maven.compiler.target>
+
+ <extraJavaTestArgs>
+ -XX:+IgnoreUnrecognizedVMOptions
+ --add-opens=java.base/java.lang=ALL-UNNAMED
+ --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
+ --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
+ --add-opens=java.base/java.io=ALL-UNNAMED
+ --add-opens=java.base/java.net=ALL-UNNAMED
+ --add-opens=java.base/java.nio=ALL-UNNAMED
+ --add-opens=java.base/java.util=ALL-UNNAMED
+ --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
+ --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
+ --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED
+ --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
+ --add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED
+ --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
+ --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
+ --add-exports=java.base/sun.nio.ch=ALL-UNNAMED
+ --add-opens=java.base/sun.nio.cs=ALL-UNNAMED
+ --add-opens=java.base/sun.security.action=ALL-UNNAMED
+ --add-opens=java.base/sun.util.calendar=ALL-UNNAMED
+ -Djdk.reflect.useDirectMethodHandle=false
+ -Dio.netty.tryReflectionSetAccessible=true
+ </extraJavaTestArgs>
</properties>
<modules>
@@ -69,7 +99,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
+ <version>3.11.0</version>
<executions>
<!-- Replacing default-compile as it is treated specially
by maven -->
<execution>
@@ -97,8 +127,9 @@
</execution>
</executions>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
+ <!-- The default configuration will be overridden by
Profile -->
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
<encoding>UTF-8</encoding>
<fork>true</fork>
<meminitial>512m</meminitial>
@@ -108,7 +139,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>3.0.1</version>
+ <version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -123,7 +154,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.8.1</version>
+ <version>0.8.8</version>
<executions>
<execution>
<id>default-prepare-agent</id>
@@ -160,7 +191,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>3.0.0-M3</version>
+ <version>${maven-surefire.version}</version>
<executions>
<execution>
<id>default-test</id>
@@ -169,7 +200,7 @@
<goal>test</goal>
</goals>
<configuration>
- <argLine>${coverageAgent}</argLine>
+ <argLine>${coverageAgent}
${extraJavaTestArgs}</argLine>
</configuration>
</execution>
</executions>
@@ -179,7 +210,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.17</version>
+ <version>3.3.0</version>
<configuration>
<configLocation>tools/checkstyle.xml</configLocation>
<excludes>**/generated/**/*,**/proto/**/*</excludes>
@@ -195,7 +226,7 @@
<dependency>
<artifactId>checkstyle</artifactId>
<groupId>com.puppycrawl.tools</groupId>
- <version>7.1</version>
+ <version>8.45</version>
</dependency>
</dependencies>
<executions>
@@ -314,6 +345,44 @@
</build>
<profiles>
+ <!-- Profile 1: Activated when JDK 8 is detected -->
+ <profile>
+ <id>jdk8</id>
+ <activation>
+ <jdk>1.8</jdk>
+ </activation>
+ <properties>
+ <jdk.version>1.8</jdk.version>
+ </properties>
+ </profile>
+
+ <!-- Profile 2: Activated when JDK 11+ is detected -->
+ <profile>
+ <id>jdk11</id>
+ <activation>
+ <jdk>[11,)</jdk>
+ </activation>
+ <properties>
+ <jdk.version>11</jdk.version>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
+ <compilerArgs>
+ <arg>--add-exports</arg>
+ <arg>java.base/sun.nio.ch=ALL-UNNAMED</arg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
<profile>
<id>release</id>
<build>
diff --git a/tools/checkstyle.xml b/tools/checkstyle.xml
index 3bc05e77..26d9130a 100644
--- a/tools/checkstyle.xml
+++ b/tools/checkstyle.xml
@@ -37,6 +37,12 @@
<!-- <module name="SuppressionCommentFilter"/>-->
+ <module name="LineLength">
+ <property name="max" value="200"/>
+ <property name="ignorePattern"
+ value="^package.*|^import.*|a
href|href|http://|https://|ftp://"/>
+ </module>
+
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
@@ -50,11 +56,7 @@
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
- <module name="LineLength">
- <property name="max" value="200"/>
- <property name="ignorePattern"
- value="^package.*|^import.*|a
href|href|http://|https://|ftp://"/>
- </module>
+
<!--<module name="AvoidStarImport"/>-->
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
@@ -230,15 +232,10 @@
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF,
CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
- <property name="scope" value="public"/>
+ <property name="accessModifiers" value="public, protected"/>
<property name="allowMissingParamTags" value="true"/>
- <property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
- <!-- Allow missing java doc -->
- <property name="allowMissingJavadoc" value="true"/>
- <property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
- <property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<module name="MethodName">
<message key="name.invalidPattern"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]