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 b8bd1fd674270..4879622e9d6aa 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 @@ -25,13 +25,6 @@ ShardingSphere JDBC 要求在如下或更高版本的 `GraalVM CE` 完成构建 ```shell com.sun.beans.introspect.ClassInfo was unintentionally initialized at build time. To see why com.sun.beans.introspect.ClassInfo got initialized use --trace-class-initialization=com.sun.beans.introspect.ClassInfo java.beans.Introspector was unintentionally initialized at build time. To see why java.beans.Introspector got initialized use --trace-class-initialization=java.beans.Introspector -com.sun.beans.util.Cache$Kind$2 was unintentionally initialized at build time. To see why com.sun.beans.util.Cache$Kind$2 got initialized use --trace-class-initialization=com.sun.beans.util.Cache$Kind$2 -com.sun.beans.TypeResolver was unintentionally initialized at build time. To see why com.sun.beans.TypeResolver got initialized use --trace-class-initialization=com.sun.beans.TypeResolver -java.beans.ThreadGroupContext was unintentionally initialized at build time. To see why java.beans.ThreadGroupContext got initialized use --trace-class-initialization=java.beans.ThreadGroupContext -com.sun.beans.util.Cache$Kind was unintentionally initialized at build time. To see why com.sun.beans.util.Cache$Kind got initialized use --trace-class-initialization=com.sun.beans.util.Cache$Kind -com.sun.beans.introspect.MethodInfo was unintentionally initialized at build time. To see why com.sun.beans.introspect.MethodInfo got initialized use --trace-class-initialization=com.sun.beans.introspect.MethodInfo -com.sun.beans.util.Cache$Kind$1 was unintentionally initialized at build time. To see why com.sun.beans.util.Cache$Kind$1 got initialized use --trace-class-initialization=com.sun.beans.util.Cache$Kind$1 -com.sun.beans.util.Cache$Kind$3 was unintentionally initialized at build time. To see why com.sun.beans.util.Cache$Kind$3 got initialized use --trace-class-initialization=com.sun.beans.util.Cache$Kind$3 ``` ### Maven 生态 @@ -87,7 +80,7 @@ com.sun.beans.util.Cache$Kind$3 was unintentionally initialized at build time. T 使用者需要主动使用 GraalVM Reachability Metadata 中央仓库。 如下配置可供参考,以配置项目额外的 Gradle Tasks,以 GraalVM Native Build Tools 的文档为准。 -由于 Gradle 8.6 的限制,用户需要通过 Maven 依赖的形式引入 Metadata Repository 的 JSON 文件。 +由于 https://github.com/gradle/gradle/issues/17559 的限制,用户需要通过 Maven 依赖的形式引入 Metadata Repository 的 JSON 文件。 参考 https://github.com/graalvm/native-build-tools/issues/572 。 ```groovy @@ -346,7 +339,7 @@ ShardingSphere 定义了 `shardingsphere-test-native` 的 Maven Module 用于为 ShardingSphere 定义了 `nativeTestInShardingSphere` 的 Maven Profile 用于为 `shardingsphere-test-native` 模块执行 nativeTest 。 -假设贡献者处于新的 Ubuntu 22.04.3 LTS 实例下,其可通过如下 bash 命令通过 SDKMAN! 管理 JDK 和工具链, +假设贡献者处于新的 Ubuntu 22.04.4 LTS 实例下,其可通过如下 bash 命令通过 SDKMAN! 管理 JDK 和工具链, 并为 `shardingsphere-test-native` 子模块执行 nativeTest。 你必须安装 Docker Engine 以执行 `testcontainers-java` 相关的单元测试。 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 ab76d2834ae59..18547ec9a0c53 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 @@ -26,13 +26,6 @@ GraalVM CE only supports AWT for GraalVM CE For JDK22 and higher versions. ```shell com.sun.beans.introspect.ClassInfo was unintentionally initialized at build time. To see why com.sun.beans.introspect.ClassInfo got initialized use --trace-class-initialization=com.sun.beans.introspect.ClassInfo java.beans.Introspector was unintentionally initialized at build time. To see why java.beans.Introspector got initialized use --trace-class-initialization=java.beans.Introspector -com.sun.beans.util.Cache$Kind$2 was unintentionally initialized at build time. To see why com.sun.beans.util.Cache$Kind$2 got initialized use --trace-class-initialization=com.sun.beans.util.Cache$Kind$2 -com.sun.beans.TypeResolver was unintentionally initialized at build time. To see why com.sun.beans.TypeResolver got initialized use --trace-class-initialization=com.sun.beans.TypeResolver -java.beans.ThreadGroupContext was unintentionally initialized at build time. To see why java.beans.ThreadGroupContext got initialized use --trace-class-initialization=java.beans.ThreadGroupContext -com.sun.beans.util.Cache$Kind was unintentionally initialized at build time. To see why com.sun.beans.util.Cache$Kind got initialized use --trace-class-initialization=com.sun.beans.util.Cache$Kind -com.sun.beans.introspect.MethodInfo was unintentionally initialized at build time. To see why com.sun.beans.introspect.MethodInfo got initialized use --trace-class-initialization=com.sun.beans.introspect.MethodInfo -com.sun.beans.util.Cache$Kind$1 was unintentionally initialized at build time. To see why com.sun.beans.util.Cache$Kind$1 got initialized use --trace-class-initialization=com.sun.beans.util.Cache$Kind$1 -com.sun.beans.util.Cache$Kind$3 was unintentionally initialized at build time. To see why com.sun.beans.util.Cache$Kind$3 got initialized use --trace-class-initialization=com.sun.beans.util.Cache$Kind$3 ``` ### Maven Ecology @@ -90,7 +83,7 @@ and the documentation of GraalVM Native Build Tools shall prevail. Users need to actively use the GraalVM Reachability Metadata central repository. The following configuration is for reference to configure additional Gradle Tasks for the project, and the documentation of GraalVM Native Build Tools shall prevail. -Due to the limitations of Gradle 8.6, +Due to the limitations of https://github.com/gradle/gradle/issues/17559 , users need to introduce the JSON file of Metadata Repository through Maven dependency. Reference https://github.com/graalvm/native-build-tools/issues/572 . @@ -362,7 +355,7 @@ This subset of unit tests avoids the use of third-party libraries such as Mockit ShardingSphere defines the Maven Profile of `nativeTestInShardingSphere` for executing nativeTest for the `shardingsphere-test-native` module. -Assuming that the contributor is under a new Ubuntu 22.04.3 LTS instance, Contributors can manage the JDK and tool chain through +Assuming that the contributor is under a new Ubuntu 22.04.4 LTS instance, Contributors can manage the JDK and tool chain through `SDKMAN!` through the following bash command, and execute nativeTest for the `shardingsphere-test-native` submodule. You must install Docker Engine to execute `testcontainers-java` related unit tests. @@ -386,7 +379,7 @@ on https://github.com/oracle/graalvm-reachability-metadata . ShardingSphere acti some third-party libraries in the `shardingsphere-infra-reachability-metadata` submodule. If nativeTest execution fails, preliminary GraalVM Reachability Metadata should be generated for unit tests, -and manually adjust the contents of the `META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata` folder on the classpath of the `shardingsphere-infra-reachability-metadata` submodule to fix nativeTest. +and manually adjust the contents of the `META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/` folder on the classpath of the `shardingsphere-infra-reachability-metadata` submodule to fix nativeTest. If necessary, use the `org.junit.jupiter.api.condition.DisabledInNativeImage` annotation or the `org.graalvm.nativeimage.imagecode` System Property blocks some unit tests from running under GraalVM Native Image. diff --git a/infra/database/type/hive/pom.xml b/infra/database/type/hive/pom.xml index 671a4a6fd95f9..81e63225739f9 100644 --- a/infra/database/type/hive/pom.xml +++ b/infra/database/type/hive/pom.xml @@ -36,6 +36,16 @@ org.apache.hive hive-jdbc + ${hive.version} + provided + true + + + io.github.linghengqian + hive-server2-jdbc-driver-thin + ${hive-server2-jdbc-driver-thin.version} + provided + true diff --git a/infra/database/type/hive/src/main/java/org/apache/shardingsphere/infra/database/hive/metadata/data/loader/HiveMetaDataLoader.java b/infra/database/type/hive/src/main/java/org/apache/shardingsphere/infra/database/hive/metadata/data/loader/HiveMetaDataLoader.java index 6c58c7aeb9aa6..df7da760166a4 100644 --- a/infra/database/type/hive/src/main/java/org/apache/shardingsphere/infra/database/hive/metadata/data/loader/HiveMetaDataLoader.java +++ b/infra/database/type/hive/src/main/java/org/apache/shardingsphere/infra/database/hive/metadata/data/loader/HiveMetaDataLoader.java @@ -23,6 +23,7 @@ import org.apache.hadoop.hive.metastore.api.Table; import org.apache.shardingsphere.infra.database.core.metadata.data.loader.DialectMetaDataLoader; import org.apache.shardingsphere.infra.database.core.metadata.data.loader.MetaDataLoaderMaterial; +import org.apache.shardingsphere.infra.database.core.metadata.data.loader.type.TableMetaDataLoader; import org.apache.shardingsphere.infra.database.core.metadata.data.model.ColumnMetaData; import org.apache.shardingsphere.infra.database.core.metadata.data.model.SchemaMetaData; import org.apache.shardingsphere.infra.database.core.metadata.data.model.TableMetaData; @@ -31,7 +32,9 @@ import javax.sql.DataSource; import java.sql.Connection; +import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Statement; import java.sql.Types; import java.util.Collection; import java.util.Collections; @@ -45,13 +48,27 @@ public final class HiveMetaDataLoader implements DialectMetaDataLoader { private static final String HIVE_METASTORE_URIS = "hive.metastore.uris"; + @SuppressWarnings("SqlNoDataSourceInspection") @Override public Collection load(final MetaDataLoaderMaterial material) throws SQLException { + String hiveMetastoreUris; + try (Statement statement = material.getDataSource().getConnection().createStatement()) { + ResultSet resultSet = statement.executeQuery("SET hive.metastore.uris"); + resultSet.next(); + hiveMetastoreUris = resultSet.getString("set"); + } + if ("hive.metastore.uris is undefined".equals(hiveMetastoreUris)) { + Collection tableMetaData = new LinkedList<>(); + for (String each : material.getActualTableNames()) { + TableMetaDataLoader.load(material.getDataSource(), each, material.getStorageType()).ifPresent(tableMetaData::add); + } + return Collections.singletonList(new SchemaMetaData(material.getDefaultSchemaName(), tableMetaData)); + } HiveMetaStoreClient storeClient = null; try { // TODO Support set hive.metastore uris when register storage unit. HiveConf hiveConf = new HiveConf(); - hiveConf.set(HIVE_METASTORE_URIS, ""); + hiveConf.set(HIVE_METASTORE_URIS, hiveMetastoreUris); storeClient = new HiveMetaStoreClient(hiveConf); return Collections.singletonList(new SchemaMetaData(material.getDefaultSchemaName(), getTableMetaData(storeClient.getAllTables(material.getDefaultSchemaName()), storeClient, material))); diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json index 5bcd4e57449d6..fd7dc365d0f80 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reflect-config.json @@ -84,6 +84,25 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"}, "name":"org.apache.shardingsphere.authority.yaml.config.YamlAuthorityRuleConfiguration" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.global.GlobalRulePersistService"}, + "name":"org.apache.shardingsphere.authority.yaml.config.YamlAuthorityRuleConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"getAuthenticators","parameterTypes":[] }, {"name":"getDefaultAuthenticator","parameterTypes":[] }, {"name":"getPrivilege","parameterTypes":[] }, {"name":"getUsers","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.authority.yaml.config.YamlAuthorityRuleConfiguration", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.authority.yaml.config.YamlAuthorityRuleConfigurationBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.authority.yaml.config.YamlAuthorityRuleConfigurationCustomizer" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor"}, "name":"org.apache.shardingsphere.broadcast.route.BroadcastSQLRouter" @@ -266,6 +285,25 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"}, "name":"org.apache.shardingsphere.globalclock.yaml.config.YamlGlobalClockRuleConfiguration" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.global.GlobalRulePersistService"}, + "name":"org.apache.shardingsphere.globalclock.yaml.config.YamlGlobalClockRuleConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"getProps","parameterTypes":[] }, {"name":"getProvider","parameterTypes":[] }, {"name":"getType","parameterTypes":[] }, {"name":"isEnabled","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.globalclock.yaml.config.YamlGlobalClockRuleConfiguration", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.globalclock.yaml.config.YamlGlobalClockRuleConfigurationBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.globalclock.yaml.config.YamlGlobalClockRuleConfigurationCustomizer" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.yaml.YamlEngine"}, "name":"org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration", @@ -540,12 +578,12 @@ "name":"org.apache.shardingsphere.infra.util.eventbus.EventSubscriber" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.event.subsciber.DeliverEventSubscriberRegistry$$Lambda/0x00007f484f4738b8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.event.subsciber.DeliverEventSubscriberRegistry$$Lambda/0x00007f35bb470bf8"}, "name":"org.apache.shardingsphere.infra.util.eventbus.EventSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.infra.util.eventbus.EventSubscriber", "queryAllDeclaredMethods":true }, @@ -559,6 +597,11 @@ "name":"org.apache.shardingsphere.infra.util.yaml.YamlConfiguration", "queryAllPublicMethods":true }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.persist.ClusterMetaDataManagerPersistService"}, + "name":"org.apache.shardingsphere.infra.util.yaml.YamlConfiguration", + "queryAllPublicMethods":true +}, { "condition":{"typeReachable":"org.apache.shardingsphere.mode.persist.service.ComputeNodePersistService"}, "name":"org.apache.shardingsphere.infra.util.yaml.YamlConfiguration", @@ -595,7 +638,7 @@ "name":"org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfigurationCustomizer" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.yaml.YamlEngine"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, "name":"org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlGlobalRuleConfiguration", "queryAllPublicMethods":true }, @@ -680,6 +723,19 @@ "allDeclaredFields":true, "methods":[{"name":"","parameterTypes":[] }, {"name":"getColumns","parameterTypes":[] }, {"name":"getConstraints","parameterTypes":[] }, {"name":"getIndexes","parameterTypes":[] }, {"name":"getName","parameterTypes":[] }, {"name":"getType","parameterTypes":[] }, {"name":"setColumns","parameterTypes":["java.util.Map"] }, {"name":"setIndexes","parameterTypes":["java.util.Map"] }, {"name":"setName","parameterTypes":["java.lang.String"] }, {"name":"setType","parameterTypes":["org.apache.shardingsphere.infra.database.core.metadata.database.enums.TableType"] }] }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.persist.ClusterMetaDataManagerPersistService"}, + "name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTable", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.persist.ClusterMetaDataManagerPersistService"}, + "name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTableBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.persist.ClusterMetaDataManagerPersistService"}, + "name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTableCustomizer" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.rule.builder.global.GlobalRulesBuilder"}, "name":"org.apache.shardingsphere.logging.rule.builder.LoggingRuleBuilder" @@ -841,7 +897,7 @@ "name":"org.apache.shardingsphere.mask.yaml.config.rule.YamlMaskTableRuleConfigurationCustomizer" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.event.subsciber.DeliverEventSubscriberRegistry$$Lambda/0x00007f484f4738b8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.event.subsciber.DeliverEventSubscriberRegistry$$Lambda/0x00007f35bb470bf8"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.deliver.DeliverQualifiedDataSourceSubscriber", "queryAllDeclaredMethods":true }, @@ -851,42 +907,42 @@ "methods":[{"name":"cleanCache","parameterTypes":["org.apache.shardingsphere.mode.event.dispatch.DispatchEvent"] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.CacheEvictedSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ComputeNodeOnlineSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.DatabaseChangedSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.GlobalRuleConfigurationEventSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ListenerAssistedSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ProcessListChangedSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.PropertiesEventSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.QualifiedDataSourceSubscriber", "queryAllDeclaredMethods":true }, @@ -895,26 +951,26 @@ "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ResourceMetaDataChangedSubscriber" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ResourceMetaDataChangedSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.listener.MetaDataChangedListener$$Lambda/0x00007f484f5d2048"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.listener.MetaDataChangedListener$$Lambda/0x00007f35bb5d31e8"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ResourceMetaDataChangedSubscriber" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.RuleItemChangedSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.StateChangedSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f484f48d3f8"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.registry.ClusterDispatchEventSubscriberRegistry$$Lambda/0x00007f35bb48eee0"}, "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.StorageUnitEventSubscriber", "queryAllDeclaredMethods":true }, @@ -983,6 +1039,25 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"}, "name":"org.apache.shardingsphere.parser.yaml.config.YamlSQLParserRuleConfiguration" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.global.GlobalRulePersistService"}, + "name":"org.apache.shardingsphere.parser.yaml.config.YamlSQLParserRuleConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"getParseTreeCache","parameterTypes":[] }, {"name":"getSqlStatementCache","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.parser.yaml.config.YamlSQLParserRuleConfiguration", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.parser.yaml.config.YamlSQLParserRuleConfigurationBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.parser.yaml.config.YamlSQLParserRuleConfigurationCustomizer" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPILoader"}, "name":"org.apache.shardingsphere.readwritesplitting.checker.ReadwriteSplittingRuleConfigurationChecker" @@ -1583,6 +1658,25 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"}, "name":"org.apache.shardingsphere.sqlfederation.yaml.config.YamlSQLFederationRuleConfiguration" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.global.GlobalRulePersistService"}, + "name":"org.apache.shardingsphere.sqlfederation.yaml.config.YamlSQLFederationRuleConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"getExecutionPlanCache","parameterTypes":[] }, {"name":"isAllQueryUseSQLFederation","parameterTypes":[] }, {"name":"isSqlFederationEnabled","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.sqlfederation.yaml.config.YamlSQLFederationRuleConfiguration", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.sqlfederation.yaml.config.YamlSQLFederationRuleConfigurationBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.sqlfederation.yaml.config.YamlSQLFederationRuleConfigurationCustomizer" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.sqltranslator.rule.SQLTranslatorRule"}, "name":"org.apache.shardingsphere.sqltranslator.natived.NativeSQLTranslator" @@ -1599,6 +1693,25 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"}, "name":"org.apache.shardingsphere.sqltranslator.yaml.config.YamlSQLTranslatorRuleConfiguration" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.global.GlobalRulePersistService"}, + "name":"org.apache.shardingsphere.sqltranslator.yaml.config.YamlSQLTranslatorRuleConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"getProps","parameterTypes":[] }, {"name":"getType","parameterTypes":[] }, {"name":"isUseOriginalSQLWhenTranslatingFailed","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.sqltranslator.yaml.config.YamlSQLTranslatorRuleConfiguration", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.sqltranslator.yaml.config.YamlSQLTranslatorRuleConfigurationBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.sqltranslator.yaml.config.YamlSQLTranslatorRuleConfigurationCustomizer" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.rule.builder.global.GlobalRulesBuilder"}, "name":"org.apache.shardingsphere.timeservice.core.rule.builder.DefaultTimestampServiceConfigurationBuilder" @@ -1649,7 +1762,6 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.yaml.YamlEngine"}, "name":"org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfiguration", "allDeclaredFields":true, - "queryAllPublicMethods":true, "methods":[{"name":"","parameterTypes":[] }, {"name":"setDefaultType","parameterTypes":["java.lang.String"] }, {"name":"setProviderType","parameterTypes":["java.lang.String"] }] }, { @@ -1657,11 +1769,22 @@ "name":"org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfiguration" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.yaml.YamlEngine"}, + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.config.global.GlobalRulePersistService"}, + "name":"org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"getDefaultType","parameterTypes":[] }, {"name":"getProps","parameterTypes":[] }, {"name":"getProviderType","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, + "name":"org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfiguration", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, "name":"org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfigurationBeanInfo" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.yaml.YamlEngine"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, "name":"org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfigurationCustomizer" } ] \ No newline at end of file diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json index 492f2a423c84d..cb3d89b3b8454 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json @@ -192,6 +192,9 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.cluster.lock.holder.DistributedLockHolder"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.decorator.RuleConfigurationPersistDecorateEngine"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.spi.RuleConfigurationPersistDecorator\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.readwritesplitting.route.standard.StandardReadwriteSplittingDataSourceRouter"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.readwritesplitting.route.standard.filter.ReadDataSourcesFilter\\E" diff --git a/pom.xml b/pom.xml index 0fa51e1ce57ef..45cf9cbb3fb3e 100644 --- a/pom.xml +++ b/pom.xml @@ -125,7 +125,8 @@ 3.1.0-og 2.4.2 0.6.3 - 3.1.3 + 4.0.0 + 1.0.0 0.282 4.0.3 @@ -145,34 +146,6 @@ 24.0.2 4.4.6 - 2.9.9 - 1.9.13 - 2.6 - 1.9.4 - 1.4 - 1.26.2 - 2.11.0 - 3.6 - 4.5.14 - 4.4.15 - 4.0 - 3.1.0 - 1.7.7 - 0.9.3 - 4.41.1 - 3.2.1 - 1.0.18 - 1.19 - 9.3.20.v20170531 - 2.14.3 - 3.0.2 - 1.1.10.5 - 1.5.4 - 2.4.1 - 3.6.0 - 1.7 - 10.14.2.0 - 0.6.1 1.4.13 @@ -503,158 +476,6 @@ http test - - org.apache.hive - hive-jdbc - ${hive.version} - provided - - - org.glassfish - javax.el - - - com.github.joshelser - dropwizard-metrics-hadoop-metrics2-reporter - - - com.zaxxer - HikariCP-java7 - - - org.slf4j - slf4j-log4j12 - - - org.apache.logging.log4j - log4j-slf4j-impl - - - org.apache.logging.log4j - log4j-1.2-api - - - commons-collections - commons-collections - - - jdk.tools - jdk.tools - - - log4j - log4j - - - org.apache.logging.log4j - log4j-web - - - org.apache.hadoop - hadoop-yarn-server-resourcemanager - - - org.eclipse.jetty - jetty-http - - - org.eclipse.jetty - jetty-rewrite - - - org.eclipse.jetty - jetty-server - - - org.eclipse.jetty - jetty-servlet - - - org.eclipse.jetty - jetty-webapp - - - org.apache.orc - orc-core - - - com.jcraft - jsch - - - jline - jline - - - io.dropwizard.metrics - metrics-core - - - io.dropwizard.metrics - metrics-json - - - io.dropwizard.metrics - metrics-jvm - - - org.apache.ant - ant - - - org.apache.hive - hive-serde - - - co.cask.tephra - tephra-api - - - co.cask.tephra - tephra-core - - - co.cask.tephra - tephra-hbase-compat-1.0 - - - org.eclipse.jetty - jetty-util - - - com.sun.jersey - jersey-servlet - - - org.jruby.joni - joni - - - sqlline - sqlline - - - org.apache.hbase - hbase-metrics - - - org.apache.hbase - hbase-metrics-api - - - com.jolbox - bonecp - - - commons-dbcp - commons-dbcp - - - junit - junit - - - com.facebook.presto presto-jdbc @@ -743,188 +564,6 @@ ${jedis.version} provided - - - joda-time - joda-time - ${joda-time.version} - - - org.codehaus.jackson - jackson-core-asl - ${jackson-asl.version} - - - org.codehaus.jackson - jackson-mapper-asl - ${jackson-asl.version} - - - commons-lang - commons-lang - ${commons-lang.version} - - - commons-beanutils - commons-beanutils - ${commons-beanutils.version} - - - commons-cli - commons-cli - ${commons-cli.version} - - - org.apache.commons - commons-compress - ${commons-compress.version} - - - commons-io - commons-io - ${commons-io.version} - - - commons-net - commons-net - ${commons-net.version} - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - org.apache.httpcomponents - httpcore - ${httpcore.version} - - - com.google.inject - guice - ${guice.version} - - - com.google.inject.extensions - guice-servlet - ${guice.version} - - - - org.apache.hadoop - hadoop-annotations - ${hadoop.version} - - - org.apache.hadoop - hadoop-common - ${hadoop.version} - - - org.apache.hadoop - hadoop-auth - ${hadoop.version} - - - org.apache.hadoop - hadoop-hdfs - ${hadoop.version} - - - org.apache.hadoop - hadoop-yarn-api - ${hadoop.version} - - - org.apache.hadoop - hadoop-yarn-common - ${hadoop.version} - - - org.apache.hadoop - hadoop-yarn-server-common - ${hadoop.version} - - - org.apache.avro - avro - ${avro.version} - - - org.apache.thrift - libthrift - ${libthrift.version} - - - com.nimbusds - nimbus-jose-jwt - ${nimbus.version} - - - io.dropwizard.metrics - metrics-core - ${metrics-core.version} - - - org.jruby.jcodings - jcodings - ${jcodings.version} - - - com.sun.jersey - jersey-core - ${jersey.version} - - - com.sun.jersey - jersey-server - ${jersey.version} - - - org.eclipse.jetty - jetty-security - ${jetty.version} - - - org.eclipse.jetty - jetty-util-ajax - ${jetty.version} - - - com.google.code.findbugs - jsr305 - ${jsr305.version} - - - org.xerial.snappy - snappy-java - ${snappy.version} - - - org.codehaus.jettison - jettison - ${jettison.version} - - - org.jamon - jamon-runtime - ${jamon.version} - - - com.squareup.okio - okio - ${okio.version} - - - com.google.re2j - re2j - ${re2j.version} - - - org.apache.derby - derby - ${derby.version} - @@ -1338,7 +977,6 @@ maven-surefire-plugin - false --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/sun.net=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/base/SeataTest.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/base/SeataTest.java index ea909f7611ba7..2017e35e86550 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/base/SeataTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/base/SeataTest.java @@ -19,7 +19,6 @@ import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; -import org.apache.hc.core5.http.HttpStatus; import org.apache.shardingsphere.test.natived.jdbc.commons.TestShardingService; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -41,14 +40,11 @@ @Testcontainers class SeataTest { - /** - * TODO Further processing of `/health` awaits apache/incubator-seata#6356. - */ @SuppressWarnings("resource") @Container - public static final GenericContainer CONTAINER = new GenericContainer<>("seataio/seata-server:1.8.0") + public static final GenericContainer CONTAINER = new GenericContainer<>("apache/seata-server:2.1.0") .withExposedPorts(7091, 8091) - .waitingFor(Wait.forHttp("/health").forPort(7091).forStatusCode(HttpStatus.SC_UNAUTHORIZED)); + .waitingFor(Wait.forHttp("/health").forPort(7091).forResponsePredicate(s -> s.equals("ok"))); private static final String SERVICE_DEFAULT_GROUP_LIST_KEY = "service.default.grouplist";