From 669dd656a53e0a8a7ebf20ddc21b46c56876777a Mon Sep 17 00:00:00 2001 From: linghengqian Date: Sun, 18 Aug 2024 14:30:14 +0800 Subject: [PATCH] Refactor of the way Lambda job classes are identified --- .github/workflows/graalvm.yml | 3 +- RELEASE-NOTES.md | 31 +++++++++++++++++-- .../setup/DefaultJobClassNameProvider.java | 2 +- .../DefaultJobClassNameProviderTest.java | 6 +--- test/native/pom.xml | 4 +-- 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index 3e3a79859d..5e5b1277ee 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -23,8 +23,7 @@ on: paths: - '.github/workflows/graalvm.yml' - 'reachability-metadata/src/**' - - 'test/native/native-image-filter/**' - - 'test/native/src/**' + - 'test/native/**' jobs: build: diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index f32ac216ed..18e002d95e 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,9 +1,36 @@ +## Release 3.1.0-SNAPSHOT + +### API Changes + +1. Kernel: Refactor of the way Lambda job classes are identified - [#2370](https://github.com/apache/shardingsphere-elasticjob/issues/2370) + +### New Features + +### Enhancements + +1. Bootstrap: Provides built-in GraalVM Reachability Metadata and nativeTest on Elasticjob Bootstrap - [#2268](https://github.com/apache/shardingsphere-elasticjob/pull/2268) +1. Build: Support for building with OpenJDK 22 - [#2407](https://github.com/apache/shardingsphere-elasticjob/issues/2407) +1. Spring Boot Starter: Block `elasticjob-spring-boot-starter` from passing `spring-boot-starter` test scope dependencies - [#2418](https://github.com/apache/shardingsphere-elasticjob/issues/2418) +1. Lifecycle: Support dynamic configuration of jobs through the Operation API in GraalVM Native Image - [#2426](https://github.com/apache/shardingsphere-elasticjob/pull/2426) +1. Doc: Adds documentation for connecting to Zookeeper Server with SASL enabled - [#2442](https://github.com/apache/shardingsphere-elasticjob/pull/2442) +1. Build: Support building and using ElasticJob with JDK23 - [#2453](https://github.com/apache/shardingsphere-elasticjob/issues/2453) +1. Build: Support building and using ElasticJob with JDK23 - [#2453](https://github.com/apache/shardingsphere-elasticjob/issues/2453) + +### Bug Fixes + +1. Build: Removes non-existent `elasticjob-tracing-api` and `elasticjob-error-handler-spi` module - [#2412](https://github.com/apache/shardingsphere-elasticjob/pull/2412) +1. Spring Boot Starter: Fixes the issue that OneOffJobBootstrap cannot be used under ElasticJob Spring Boot Starter - [#2014](https://github.com/apache/shardingsphere-elasticjob/issues/2014) + +### Change Logs + +1. [MILESTONE](https://github.com/apache/shardingsphere-elasticjob/milestone/7) + ## 3.0.4 -## Dependencies Upgrade +### Dependencies Upgrade 1. Update dependencies to fix CVE -## Enhancements +### Enhancements 1. Support for building with OpenJDK 21 2. Accelerate the startup speed of ElasticJob 3. Migrate from Junit Vintage to Junit Jupiter diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProvider.java index 4700a24f3a..0acf5109b9 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProvider.java @@ -24,7 +24,7 @@ */ public final class DefaultJobClassNameProvider implements JobClassNameProvider { - private static final String LAMBDA_CHARACTERISTICS = "$$Lambda$"; + private static final String LAMBDA_CHARACTERISTICS = "$$Lambda"; @Override public String getJobClassName(final ElasticJob elasticJob) { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProviderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProviderTest.java index 03cd4941eb..3ea444bf16 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProviderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProviderTest.java @@ -20,8 +20,6 @@ import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledForJreRange; -import org.junit.jupiter.api.condition.JRE; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -35,14 +33,12 @@ void assertGetOrdinaryClassJobName() { assertThat(result, is("org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob")); } - // TODO OpenJDK 21 breaks this unit test. @Test - @DisabledForJreRange(min = JRE.JAVA_21, max = JRE.OTHER) void assertGetLambdaJobName() { JobClassNameProvider jobClassNameProvider = new DefaultJobClassNameProvider(); FooJob lambdaFooJob = shardingContext -> { }; String result = jobClassNameProvider.getJobClassName(lambdaFooJob); - assertThat(result, is("org.apache.shardingsphere.elasticjob.kernel.internal.setup.DefaultJobClassNameProviderTest$$Lambda$")); + assertThat(result, is("org.apache.shardingsphere.elasticjob.kernel.internal.setup.DefaultJobClassNameProviderTest$$Lambda")); } } diff --git a/test/native/pom.xml b/test/native/pom.xml index 805c2ea153..417e9c0d5e 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -29,9 +29,9 @@ true - 3.3.4 + 3.3.5 2.0.16 - 1.5.8 + 1.5.11