diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index b693625696fff..ed19702f76e38 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -107,7 +107,8 @@ jobs: build-proxy-native-image: if: github.repository == 'apache/shardingsphere' - name: Build GraalVM Native Image + name: Build Proxy Native Image + needs: global-environment timeout-minutes: 90 permissions: contents: read @@ -119,7 +120,7 @@ jobs: ref: ${{ inputs.commit-id }} - uses: graalvm/setup-graalvm@v1 with: - java-version: '17.0.9' + java-version: '21.0.1' distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/cache@v3 diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 483600fb9ba92..1f8b8dca20088 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -115,7 +115,7 @@ jobs: - uses: actions/checkout@v3 - uses: graalvm/setup-graalvm@v1 with: - java-version: '17.0.9' + java-version: '21.0.1' distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/cache@v3 diff --git a/distribution/proxy-native/pom.xml b/distribution/proxy-native/pom.xml index cfbbb5fcf60c7..941021baf0871 100644 --- a/distribution/proxy-native/pom.xml +++ b/distribution/proxy-native/pom.xml @@ -72,7 +72,7 @@ release.native - 17 + 21 apache-shardingsphere-${project.version} diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md index 09a969e7ca38e..5986ba1afcb1e 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md @@ -15,7 +15,6 @@ CE 的 `native-image` 命令行工具的长篇大论的 shell 命令。 ShardingSphere JDBC 要求在如下或更高版本的 `GraalVM CE` 完成构建 GraalVM Native Image。使用者可通过 SDKMAN! 快速切换 JDK。这同理 适用于 `Oracle GraalVM`, `Liberica Native Image Kit` 和 `Mandrel` 等 `GraalVM CE` 的下游发行版。 -- GraalVM CE 23.0.2 For JDK 17.0.9,对应于 SDKMAN! 的 `17.0.9-graalce` - GraalVM CE 23.1.1 For JDK 21.0.1,对应于 SDKMAN! 的 `21.0.1-graalce` ### Maven 生态 @@ -241,8 +240,8 @@ ShardingSphere 定义了 `nativeTestInShardingSphere` 的 Maven Profile 用于 sudo apt install unzip zip curl sed -y curl -s "https://get.sdkman.io" | bash source "$HOME/.sdkman/bin/sdkman-init.sh" -sdk install java 17.0.9-graalce -sdk use java 17.0.9-graalce +sdk install java 21.0.1-graalce +sdk use java 21.0.1-graalce sudo apt-get install build-essential libz-dev zlib1g-dev -y git clone git@github.com:apache/shardingsphere.git diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md index 9f337c4006538..07ec6e1fe3003 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md @@ -16,7 +16,6 @@ ShardingSphere JDBC requires GraalVM Native Image to be built with GraalVM CE as JDK through `SDKMAN!`. Same reason applicable to downstream distributions of `GraalVM CE` such as `Oracle GraalVM`, `Liberica Native Image Kit` and `Mandrel`. -- GraalVM CE 23.0.2 For JDK 17.0.9, corresponding to `17.0.9-graalce` of SDKMAN! - GraalVM CE 23.1.1 For JDK 21.0.1, corresponding to `21.0.1-graalce` of SDKMAN! ### Maven Ecology @@ -251,8 +250,8 @@ You must install Docker Engine to execute `testcontainers-java` related unit tes sudo apt install unzip zip curl sed -y curl -s "https://get.sdkman.io" | bash source "$HOME/.sdkman/bin/sdkman-init.sh" -sdk install java 17.0.9-graalce -sdk use java 17.0.9-graalce +sdk install java 21.0.1-graalce +sdk use java 21.0.1-graalce sudo apt-get install build-essential libz-dev zlib1g-dev -y git clone git@github.com:apache/shardingsphere.git diff --git a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md index 06252a38c9f49..94c67eda8defc 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md @@ -34,7 +34,7 @@ services: 或 `GraalVM Community Edition` 的下游发行版。若使用 `SDKMAN!`, ```shell -sdk install java 17.0.9-graalce +sdk install java 21.0.1-graalce ``` 2. 根据 https://www.graalvm.org/jdk17/reference-manual/native-image/#prerequisites 的要求安装本地工具链。 @@ -82,7 +82,7 @@ sdk install java 17.0.9-graalce - 通过命令行构建 GraalVM Native Image。 ```bash -./mvnw -am -pl distribution/proxy-native -B -T1C -Prelease.native -DskipTests clean package +./mvnw -am -pl distribution/proxy-native -T1C -Prelease.native -DskipTests clean package ``` 3. 通过命令行启动 Native Image, 需要带上 4 个参数。 @@ -97,7 +97,7 @@ sdk install java 17.0.9-graalce 4. 如果需要构建 Docker Image, 在添加存在 SPI 实现的依赖或第三方依赖后, 在命令行执行如下命令。 ```shell -./mvnw -am -pl distribution/proxy-native -B -T1C -Prelease.native,docker.native -DskipTests clean package +./mvnw -am -pl distribution/proxy-native -T1C -Prelease.native,docker.native -DskipTests clean package ``` - 假设存在包含`server.yaml` 的 `conf` 文件夹为 `./custom/conf`,可通过如下的 `docker-compose.yml` 文件启动 GraalVM Native diff --git a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md index 6a9ad55b58007..224b448f2ae68 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md @@ -37,7 +37,7 @@ services: JDK 17 according to https://www.graalvm.org/downloads/. If `SDKMAN!` is used, ```shell -sdk install java 17.0.9-graalce +sdk install java 21.0.1-graalce ``` 2. Install the local toolchain as required by https://www.graalvm.org/jdk17/reference-manual/native-image/#prerequisites. @@ -59,7 +59,7 @@ sdk install java 17.0.9-graalce Image. ```bash -./mvnw -am -pl distribution/proxy-native -B -T1C -Prelease.native -DskipTests clean package +./mvnw -am -pl distribution/proxy-native -T1C -Prelease.native -DskipTests clean package ``` - Scenario 2: It is necessary to use a JAR that has an SPI implementation or a third-party dependent JAR of a LICENSE @@ -87,7 +87,7 @@ sdk install java 17.0.9-graalce - Build GraalVM Native Image via command line. ```bash -./mvnw -am -pl distribution/proxy-native -B -T1C -Prelease.native -DskipTests clean package +./mvnw -am -pl distribution/proxy-native -T1C -Prelease.native -DskipTests clean package ``` 3. To start Native Image through the command line, you need to bring 4 parameters. The first parameter is the `Port` diff --git a/infra/expr/type/espresso/pom.xml b/infra/expr/type/espresso/pom.xml deleted file mode 100644 index 4b04bfdb79f55..0000000000000 --- a/infra/expr/type/espresso/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere - shardingsphere-infra-expr-type - 5.4.2-SNAPSHOT - - shardingsphere-infra-expr-espresso - ${project.artifactId} - - - - org.apache.shardingsphere - shardingsphere-infra-expr-spi - ${project.version} - - - org.apache.shardingsphere - shardingsphere-infra-exception-core - ${project.version} - - - org.apache.shardingsphere - shardingsphere-infra-util - ${project.version} - - - org.apache.shardingsphere - shardingsphere-test-util - ${project.version} - test - - - - org.graalvm.truffle - truffle-api - ${graal-sdk.version} - - - - - - - maven-dependency-plugin - ${maven-dependency-plugin.version} - - - copy-dependencies - - copy - - process-resources - - ${project.build.directory}/classes/espresso-need-libs - - - org.apache.groovy - groovy - ${groovy.version} - jar - true - - - true - - - - - - - diff --git a/infra/expr/type/espresso/src/main/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParser.java b/infra/expr/type/espresso/src/main/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParser.java deleted file mode 100644 index 70aac2441dafc..0000000000000 --- a/infra/expr/type/espresso/src/main/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParser.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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. - */ - -package org.apache.shardingsphere.infra.expr.espresso; - -import com.google.common.base.Strings; -import com.google.common.collect.Sets; -import groovy.lang.GroovyShell; -import org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser; -import org.apache.shardingsphere.infra.util.groovy.GroovyUtils; -import org.graalvm.polyglot.Context; -import org.graalvm.polyglot.Value; - -import java.io.File; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Properties; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * Espresso inline expression parser. - */ -public final class EspressoInlineExpressionParser implements InlineExpressionParser { - - private static final String JAVA_CLASSPATH; - - private String inlineExpression; - - /** - * TODO espressoHome not defined not yet closed. - * Maybe sometimes we need `.option("java.Properties.org.graalvm.home", System.getenv("JAVA_HOME"))` - * - * @see org.graalvm.polyglot.Context - */ - private final Context context = Context.newBuilder() - .allowAllAccess(true) - .option("java.Classpath", JAVA_CLASSPATH) - .build(); - - static { - URL resource = Thread.currentThread().getContextClassLoader().getResource("espresso-need-libs"); - String dir = null == resource ? null : resource.getPath(); - JAVA_CLASSPATH = dir + File.separator + "groovy.jar"; - } - - @Override - public void init(final Properties props) { - inlineExpression = props.getProperty(INLINE_EXPRESSION_KEY); - } - - @Override - public String handlePlaceHolder() { - return handlePlaceHolder(inlineExpression); - } - - /** - * Replace all inline expression placeholders. - * - * @param inlineExpression inline expression with {@code $->} - * @return result inline expression with {@code $} - */ - private String handlePlaceHolder(final String inlineExpression) { - return inlineExpression.contains("$->{") ? inlineExpression.replaceAll("\\$->\\{", "\\$\\{") : inlineExpression; - } - - @Override - public List splitAndEvaluate() { - return Strings.isNullOrEmpty(inlineExpression) ? Collections.emptyList() : flatten(evaluate(GroovyUtils.split(handlePlaceHolder(inlineExpression)), context)); - } - - private List evaluate(final List inlineExpressions, final Context context) { - List result = new ArrayList<>(inlineExpressions.size()); - for (String each : inlineExpressions) { - StringBuilder expression = new StringBuilder(handlePlaceHolder(each)); - if (!each.startsWith("\"")) { - expression.insert(0, '"'); - } - if (!each.endsWith("\"")) { - expression.append('"'); - } - result.add(evaluate(expression.toString(), context)); - } - return result; - } - - private Value evaluate(final String expression, final Context context) { - return context.getBindings("java") - .getMember(GroovyShell.class.getName()) - .newInstance() - .invokeMember("parse", expression) - .invokeMember("run"); - } - - private List flatten(final List segments) { - List result = new ArrayList<>(); - for (Value each : segments) { - if (!each.isString()) { - result.addAll(assemblyCartesianSegments(each)); - } else { - result.add(each.toString()); - } - } - return result; - } - - private List assemblyCartesianSegments(final Value segment) { - Set> cartesianValues = getCartesianValues(segment); - List result = new ArrayList<>(cartesianValues.size()); - for (List each : cartesianValues) { - result.add(assemblySegment(each, segment)); - } - return result; - } - - @SuppressWarnings("unchecked") - private Set> getCartesianValues(final Value segment) { - Object[] temp = segment.invokeMember("getValues").as(Object[].class); - List> result = new ArrayList<>(temp.length); - for (Object each : temp) { - if (null == each) { - continue; - } - if (each instanceof Collection) { - result.add(((Collection) each).stream().map(Object::toString).collect(Collectors.toCollection(LinkedHashSet::new))); - } else { - result.add(Sets.newHashSet(each.toString())); - } - } - return Sets.cartesianProduct(result); - } - - private String assemblySegment(final List cartesianValue, final Value segment) { - String[] temp = segment.invokeMember("getStrings").as(String[].class); - StringBuilder result = new StringBuilder(); - for (int i = 0; i < temp.length; i++) { - result.append(temp[i]); - if (i < cartesianValue.size()) { - result.append(cartesianValue.get(i)); - } - } - return result.toString(); - } - - @Override - public String getType() { - return "ESPRESSO"; - } -} diff --git a/infra/expr/type/espresso/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser b/infra/expr/type/espresso/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser deleted file mode 100644 index 12e69c796a85c..0000000000000 --- a/infra/expr/type/espresso/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.infra.expr.espresso.EspressoInlineExpressionParser diff --git a/infra/expr/type/espresso/src/test/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParserTest.java b/infra/expr/type/espresso/src/test/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParserTest.java deleted file mode 100644 index 594e58b51daf5..0000000000000 --- a/infra/expr/type/espresso/src/test/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParserTest.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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. - */ - -package org.apache.shardingsphere.infra.expr.espresso; - -import org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser; -import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; -import org.apache.shardingsphere.test.util.PropertiesBuilder; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.List; -import java.util.Properties; - -import static org.hamcrest.CoreMatchers.hasItems; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - -@Disabled("Unit tests for this class only run on GraalVM CE 23.0.1 For JDK17. Wait for https://github.com/oracle/graal/issues/7500 .") -class EspressoInlineExpressionParserTest { - - @Test - void assertEvaluateForExpressionIsNull() { - InlineExpressionParser parser = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", new Properties()); - List expected = parser.splitAndEvaluate(); - assertThat(expected, is(Collections.emptyList())); - } - - @Test - void assertEvaluateForSimpleString() { - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, " t_order_0, t_order_1 "))).splitAndEvaluate(); - assertThat(expected.size(), is(2)); - assertThat(expected, hasItems("t_order_0", "t_order_1")); - } - - @Test - void assertEvaluateForNull() { - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_order_${null}"))).splitAndEvaluate(); - assertThat(expected.size(), is(1)); - assertThat(expected, hasItems("t_order_")); - } - - @Test - void assertEvaluateForLiteral() { - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_order_${'xx'}"))).splitAndEvaluate(); - assertThat(expected.size(), is(1)); - assertThat(expected, hasItems("t_order_xx")); - } - - @Test - void assertEvaluateForArray() { - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_order_${[0, 1, 2]},t_order_item_${[0, 2]}"))).splitAndEvaluate(); - assertThat(expected.size(), is(5)); - assertThat(expected, hasItems("t_order_0", "t_order_1", "t_order_2", "t_order_item_0", "t_order_item_2")); - } - - @Test - void assertEvaluateForRange() { - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_order_${0..2},t_order_item_${0..1}"))).splitAndEvaluate(); - assertThat(expected.size(), is(5)); - assertThat(expected, hasItems("t_order_0", "t_order_1", "t_order_2", "t_order_item_0", "t_order_item_1")); - } - - @Test - void assertEvaluateForComplex() { - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_${['new','old']}_order_${1..2}, t_config"))).splitAndEvaluate(); - assertThat(expected.size(), is(5)); - assertThat(expected, hasItems("t_new_order_1", "t_new_order_2", "t_old_order_1", "t_old_order_2", "t_config")); - } - - @Test - void assertEvaluateForCalculate() { - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_${[\"new${1+2}\",'old']}_order_${1..2}"))).splitAndEvaluate(); - assertThat(expected.size(), is(4)); - assertThat(expected, hasItems("t_new3_order_1", "t_new3_order_2", "t_old_order_1", "t_old_order_2")); - } - - @Test - void assertEvaluateForExpressionPlaceHolder() { - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_$->{[\"new$->{1+2}\",'old']}_order_$->{1..2}"))).splitAndEvaluate(); - assertThat(expected.size(), is(4)); - assertThat(expected, hasItems("t_new3_order_1", "t_new3_order_2", "t_old_order_1", "t_old_order_2")); - } - - @Test - void assertEvaluateForLong() { - StringBuilder expression = new StringBuilder(); - for (int i = 0; i < 1024; i++) { - expression.append("ds_"); - expression.append(i / 64); - expression.append(".t_user_"); - expression.append(i); - if (i != 1023) { - expression.append(","); - } - } - List expected = TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, expression.toString()))).splitAndEvaluate(); - assertThat(expected.size(), is(1024)); - assertThat(expected, hasItems("ds_0.t_user_0", "ds_15.t_user_1023")); - } - - @Test - void assertHandlePlaceHolder() { - assertThat(TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_$->{[\"new$->{1+2}\"]}"))).handlePlaceHolder(), is("t_${[\"new${1+2}\"]}")); - assertThat(TypedSPILoader.getService(InlineExpressionParser.class, "ESPRESSO", PropertiesBuilder.build( - new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "t_${[\"new$->{1+2}\"]}"))).handlePlaceHolder(), is("t_${[\"new${1+2}\"]}")); - } - - /** - * This method needs to avoid returning a `Closure` class instance, and instead return the result of `Closure#call`. - * Because `Value#as` does not allow this type to be returned from the guest JVM. - * - * @see groovy.lang.Closure - * @see org.graalvm.polyglot.Value - */ - @Test - void assertEvaluateClosure() { - assertThrows(UnsupportedOperationException.class, () -> TypedSPILoader.getService( - InlineExpressionParser.class, "ESPRESSO", - PropertiesBuilder.build(new PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "${1+2}"))).evaluateClosure().call().toString()); - } -} diff --git a/infra/expr/type/pom.xml b/infra/expr/type/pom.xml index 0b3aec2b2b5e7..80654d35bea10 100644 --- a/infra/expr/type/pom.xml +++ b/infra/expr/type/pom.xml @@ -30,7 +30,6 @@ groovy literal - espresso interval diff --git a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java index 870aba4b7b114..4adaf168d0356 100644 --- a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java +++ b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java @@ -84,7 +84,7 @@ public static JDBCRepositorySQL load(final String type) { } /** - * Under the GraalVM Native Image corresponding to GraalVM CE 23.0.2 For JDK 17.0.9, although there is + * Under the GraalVM Native Image corresponding to GraalVM CE 23.1.1 For JDK 21.0.1, although there is * `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystemProvider`, the corresponding * `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem` does not autoload. This is mainly to align the * behavior of `ZipFileSystemProvider`, so ShardingSphere need to manually open and close the FileSystem diff --git a/pom.xml b/pom.xml index 3fc7b7a3f7136..99abfdea2c654 100644 --- a/pom.xml +++ b/pom.xml @@ -63,54 +63,54 @@ **/autogen/**/* - 32.1.2-jre - 3.39.0 - 2.22.0 - 1.3 + 32.1.3-jre + 3.40.0 + 2.23.0 + 2.8 - 3.12.0 + 3.14.0 1.16.0 3.6.1 2.9.3 - 2.14.2 + 2.14.3 2.4.0 - - 4.10.1 + + 4.13.1 2.2 2.10.1 2.16.0 2.8.0 - 2.4.10 - 2.4.9 - 9.3 - 4.0.10 - 2.3.31 - 1.14.8 + 2.5.0 + 2.5.0 + 9.6 + 4.0.16 + 2.3.32 + 1.14.10 8.0.0 2.3.9 1.35.0 - 2.9.3 + 2.10.0 6.0.0 5.12.4.Final 7.6.0.Final 3.2.1.Final - 1.6.1 + 2.0.0 - 4.1.99.Final - 1.70 + 4.1.101.Final + 1.77 5.5.0 3.9.1 - 0.12.0 + 0.13.0 0.7.6 4.4.4 1.4.5 - 1.58.0 - 3.21.12 + 1.59.0 + 3.25.1 4.5.14 4.12.0 @@ -118,36 +118,36 @@ 1.7.36 1.2.13 - 1.2 + 1.3.0 1.18.30 - 42.4.3 - 8.0.31 - 6.1.7.jre8-preview - 1.7.1 + 42.6.0 + 8.2.0 + 12.4.2.jre8 + 2.5.6 2.2.224 - 3.1.0-og - 2.4.2 + 5.1.0-og + 2.7.11 4.0.3 - 3.14.15 + 3.14.16 - 0.11.0 - 0.16.1 - 1.31.0 - 1.9.10 + 0.16.0 + 0.20.0 + 1.32.0 + 1.9.21 - 5.10.0 + 5.10.1 2.2 4.11.0 4.2.0 1.19.3 - 1.9.0 - + 1.10.0 + 21.2.0 - + 0.6.1 1.4.13 @@ -337,12 +337,12 @@ org.bouncycastle - bcpkix-jdk15on + bcpkix-jdk18on ${bouncycastle.version} org.bouncycastle - bctls-jdk15on + bctls-jdk18on ${bouncycastle.version} @@ -996,7 +996,7 @@ generateMetadata - 17 + 21 @@ -1060,7 +1060,7 @@ nativeTestInShardingSphere - 17 + 21 diff --git a/proxy/frontend/core/pom.xml b/proxy/frontend/core/pom.xml index 6fb9aaf411565..f9ddbc204b9ce 100644 --- a/proxy/frontend/core/pom.xml +++ b/proxy/frontend/core/pom.xml @@ -98,11 +98,11 @@ org.bouncycastle - bcpkix-jdk15on + bcpkix-jdk18on org.bouncycastle - bctls-jdk15on + bctls-jdk18on diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/FileTestUtils.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/FileTestUtils.java index ed61a51053b32..268b136b33b4a 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/FileTestUtils.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/FileTestUtils.java @@ -27,7 +27,7 @@ /** * The background for this class comes from oracle/graal#7682 - * and Accessing Resources in Native Image. + * and Accessing Resources in Native Image. * GraalVM Native Image has special features in its handling of file systems. * This means we are better off reading the file via `java.io.InputStream` instead of `java.net.URL` to avoid extra code * processing. diff --git a/test/native/src/test/resources/test-native/yaml/features/sharding.yaml b/test/native/src/test/resources/test-native/yaml/features/sharding.yaml index f15400410a72f..eac37cfb18e3a 100644 --- a/test/native/src/test/resources/test-native/yaml/features/sharding.yaml +++ b/test/native/src/test/resources/test-native/yaml/features/sharding.yaml @@ -58,7 +58,7 @@ rules: shardingColumn: user_id shardingAlgorithmName: inline shardingAlgorithms: - # `groovy.lang.Closure` related classes are not available on GraalVM CE 23.0.2 For JDK 17.0.9, + # `groovy.lang.Closure` related classes are not available on GraalVM CE 23.1.1 For JDK 21.0.1, # This CLASS_BASE algorithm class is designed to emulate INLINE's `ds_${user_id % 2}`. # See https://github.com/oracle/graal/issues/5522 . inline: