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 ac678804be491b..ed2a75dbc69372 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 @@ -47,7 +47,7 @@ java.beans.Introspector was unintentionally initialized at build time. To see wh org.graalvm.buildtools native-maven-plugin - 0.10.3 + 0.10.4 true @@ -85,12 +85,12 @@ java.beans.Introspector was unintentionally initialized at build time. To see wh ```groovy plugins { - id 'org.graalvm.buildtools.native' version '0.10.3' + id 'org.graalvm.buildtools.native' version '0.10.4' } dependencies { implementation 'org.apache.shardingsphere:shardingsphere-jdbc:${shardingsphere.version}' - implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.3', classifier: 'repository', ext: 'zip') + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.4', classifier: 'repository', ext: 'zip') } graalvmNative { 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 680f492bd3fa3e..e0bd4a94c10a37 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 @@ -49,7 +49,7 @@ and the documentation of GraalVM Native Build Tools shall prevail. org.graalvm.buildtools native-maven-plugin - 0.10.3 + 0.10.4 true @@ -89,12 +89,12 @@ Reference https://github.com/graalvm/native-build-tools/issues/572 . ```groovy plugins { - id 'org.graalvm.buildtools.native' version '0.10.3' + id 'org.graalvm.buildtools.native' version '0.10.4' } dependencies { implementation 'org.apache.shardingsphere:shardingsphere-jdbc:${shardingsphere.version}' - implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.3', classifier: 'repository', ext: 'zip') + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.4', classifier: 'repository', ext: 'zip') } graalvmNative { diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/unsupported.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/unsupported/_index.cn.md similarity index 100% rename from docs/document/content/user-manual/shardingsphere-jdbc/unsupported.cn.md rename to docs/document/content/user-manual/shardingsphere-jdbc/unsupported/_index.cn.md diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/unsupported.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/unsupported/_index.en.md similarity index 100% rename from docs/document/content/user-manual/shardingsphere-jdbc/unsupported.en.md rename to docs/document/content/user-manual/shardingsphere-jdbc/unsupported/_index.en.md diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/unsupported/p6spy/_index.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/unsupported/p6spy/_index.cn.md new file mode 100644 index 00000000000000..42306e15e8f2a2 --- /dev/null +++ b/docs/document/content/user-manual/shardingsphere-jdbc/unsupported/p6spy/_index.cn.md @@ -0,0 +1,154 @@ ++++ +title = "P6Spy" +weight = 6 ++++ + +## 背景信息 + +ShardingSphere 通过 `org.apache.shardingsphere:shardingsphere-infra-database-p6spy` 模块, +对 `com.p6spy.engine.spy.P6SpyDriver` 提供部分支持。 + +## 前提条件 + +要在 ShardingSphere 的配置文件为 MySQL Server 数据节点使用 P6Spy, 可能的 Maven 依赖关系如下, + +```xml + + + org.apache.shardingsphere + shardingsphere-jdbc + ${shardingsphere.version} + + + p6spy + p6spy + 3.9.1 + + + com.mysql + mysql-connector-j + 9.1.0 + + +``` + +## 配置示例 + +### 启动 MySQL Server + +编写 Docker Compose 文件来启动 MySQL Server。 + +```yaml +services: + mysql: + image: mysql:9.1.0 + environment: + MYSQL_ROOT_PASSWORD: example + volumes: + - ./mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + ports: + - "3306:3306" +``` + +`./docker-entrypoint-initdb.d` 文件夹包含文件为 `init.sh`,内容如下, + +```shell +#!/bin/bash +set -e + +mysql -uroot -p"$MYSQL_ROOT_PASSWORD" < + + org.apache.shardingsphere + shardingsphere-jdbc + ${shardingsphere.version} + + + p6spy + p6spy + 3.9.1 + + + com.mysql + mysql-connector-j + 9.1.0 + + +``` + +## Configuration Example + +### Start MySQL Server + +Write a Docker Compose file to start MySQL Server. + +```yaml +services: + mysql: + image: mysql:9.1.0 + environment: + MYSQL_ROOT_PASSWORD: example + volumes: + - ./mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + ports: + - "3306:3306" +``` + +The `./docker-entrypoint-initdb.d` folder contains the file `init.sh`, the content is as follows, + +```shell +#!/bin/bash +set -e + +mysql -uroot -p"$MYSQL_ROOT_PASSWORD" < - - - org.apache.shardingsphere - shardingsphere-transaction-base-seata-at - ${shardingsphere.version} - - - org.apache.seata - seata-all - 2.2.0 - - - org.antlr - antlr4-runtime - - - - - -``` diff --git a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.en.md index 9876c84742da64..cac93bf05dc931 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/optional-plugins/seata-at/_index.en.md @@ -14,7 +14,7 @@ but there are some differences, 1. If the user uses ShardingSphere JDBC in a hybrid deployment architecture, this scenario does not directly interact with ShardingSphere Proxy and is therefore not relevant to this article. This article only discusses the scenario where the business project does not use ShardingSphere JDBC 2. Seata Client only exists in ShardingSphere Proxy, and the business project does not need to rely on Seata Client -3. The R2BDC DataSource of the business project can be normally connected to the ShardingSphere Proxy with Seata integration turned on +3. The R2DBC DataSource of the business project can be normally connected to the ShardingSphere Proxy with Seata integration turned on 4. For ShardingSphere Proxy with Seata integration turned on, it is not possible to establish a `transaction propagation across services` operation to propagate transactions to other ShardingSphere Proxy instances using Seata integration or other microservices using Seata integration. If users have such needs, they should consider submitting a PR for ShardingSphere 5. The assumptions made by ShardingSphere JDBC on Seata's TCC mode are invalid on ShardingSphere Proxy 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 3b1a0f5267e944..272a3b41fece0a 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 @@ -178,3 +178,32 @@ services: 用户需要关注尚未关闭的 https://github.com/oracle/graal/issues/8177 。 若用户期望在 ShardingSphere Proxy Native 下使用这类 Java Agent,则需要关注 https://github.com/oracle/graal/pull/8077 涉及的变动。 + +## Seata AT 模式集成 + +对于 GraalVM Native Image 形态的 ShardingSphere Proxy Native, +用户始终需要修改 ShardingSphere 源代码以添加 Seata Client 和 Seata 集成的 Maven 模块,并编译为 GraalVM Native Image。 +GraalVM Native Image 形态的 ShardingSphere Proxy Native 无法识别额外添加的 JAR 文件。 + +```xml + + + + org.apache.shardingsphere + shardingsphere-transaction-base-seata-at + ${shardingsphere.version} + + + org.apache.seata + seata-all + 2.2.0 + + + org.antlr + antlr4-runtime + + + + + +``` 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 392407cf5f6586..f03450ba001e70 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 @@ -185,3 +185,32 @@ For Java Agents such as `ShardingSphere Agent`, the `native-image` component of Users need to pay attention to https://github.com/oracle/graal/issues/8177 which has not been closed. If users expect to use such Java Agents under ShardingSphere Proxy Native, they need to pay attention to the changes involved in https://github.com/oracle/graal/pull/8077 . + +## Seata AT mode integration + +For ShardingSphere Proxy Native in GraalVM Native Image, +Users always need to modify the ShardingSphere source code to add the Seata Client and Seata integrated Maven modules and compile them into GraalVM Native Image. +ShardingSphere Proxy Native in GraalVM Native Image cannot recognize the additional JAR files. + +```xml + + + + org.apache.shardingsphere + shardingsphere-transaction-base-seata-at + ${shardingsphere.version} + + + org.apache.seata + seata-all + 2.2.0 + + + org.antlr + antlr4-runtime + + + + + +``` 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 dfa0c21e71fb50..3a0b499772de7b 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 @@ -24,7 +24,7 @@ "name":"[Lcom.github.dockerjava.api.model.VolumesFrom;" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager$$Lambda/0x00007faf37e08000"}, + "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager$$Lambda/0x00007f1fabe09000"}, "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" }, { @@ -68,11 +68,11 @@ "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.metadata.factory.ExternalMetaDataFactory"}, + "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.version.MetaDataVersionPersistService"}, "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.version.MetaDataVersionPersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder"}, "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" }, { @@ -87,6 +87,10 @@ "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource"}, "name":"[Ljava.lang.String;" @@ -95,6 +99,10 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.DatabaseTypeEngine"}, "name":"[Ljava.sql.Statement;" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.core.metadata.database.datatype.DataTypeRegistry"}, + "name":"[Ljava.sql.Statement;" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.mysql.checker.MySQLDatabasePrivilegeChecker"}, "name":"[Ljava.sql.Statement;" @@ -103,6 +111,14 @@ "condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository"}, "name":"[Ljava.sql.Statement;" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, + "name":"[Ljava.sql.Statement;" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "name":"[Ljava.sql.Statement;" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.hive.metadata.data.loader.HiveMetaDataLoader"}, "name":"com.sun.security.auth.UnixPrincipal" @@ -253,10 +269,6 @@ "name":"java.lang.ClassLoader", "queryAllDeclaredMethods":true }, -{ - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "name":"java.lang.ClassLoader" -}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser"}, "name":"java.lang.Cloneable", @@ -356,7 +368,7 @@ "allDeclaredFields":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.StandaloneMetaDataManagerPersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.service.StandaloneMetaDataManagerPersistService"}, "name":"java.lang.Object", "allDeclaredFields":true }, @@ -788,10 +800,6 @@ "name":"java.util.function.ToLongFunction", "queryAllPublicMethods":true }, -{ - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "name":"java.util.logging.Logger" -}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser"}, "name":"java.util.regex.Matcher" @@ -946,7 +954,7 @@ "allDeclaredFields":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.StandaloneMetaDataManagerPersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.service.StandaloneMetaDataManagerPersistService"}, "name":"org.apache.shardingsphere.broadcast.yaml.config.YamlBroadcastRuleConfiguration", "allDeclaredFields":true }, @@ -1087,6 +1095,10 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.DatabaseTypeEngine"}, "name":"org.apache.shardingsphere.driver.ShardingSphereDriver" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.core.metadata.database.datatype.DataTypeRegistry"}, + "name":"org.apache.shardingsphere.driver.ShardingSphereDriver" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.mysql.checker.MySQLDatabasePrivilegeChecker"}, "name":"org.apache.shardingsphere.driver.ShardingSphereDriver" @@ -1096,8 +1108,12 @@ "name":"org.apache.shardingsphere.driver.ShardingSphereDriver" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement"}, - "name":"org.apache.shardingsphere.driver.executor.engine.facade.standard.StandardDriverExecutorFacadeFactory" + "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, + "name":"org.apache.shardingsphere.driver.ShardingSphereDriver" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, + "name":"org.apache.shardingsphere.driver.ShardingSphereDriver" }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.yaml.YamlEngine"}, @@ -1320,7 +1336,7 @@ "methods":[{"name":"getProps","parameterTypes":[] }, {"name":"getType","parameterTypes":[] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.StandaloneMetaDataManagerPersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.service.StandaloneMetaDataManagerPersistService"}, "name":"org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration", "allDeclaredFields":true, "methods":[{"name":"getProps","parameterTypes":[] }, {"name":"getType","parameterTypes":[] }] @@ -1401,6 +1417,18 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.props.TypedPropertyValue"}, "name":"org.apache.shardingsphere.infra.database.clickhouse.type.ClickHouseDatabaseType" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, + "name":"org.apache.shardingsphere.infra.database.firebird.connector.FirebirdConnectionPropertiesParser" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.core.type.DatabaseTypeRegistry"}, + "name":"org.apache.shardingsphere.infra.database.firebird.metadata.database.FirebirdDatabaseMetaData" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.infra.props.TypedPropertyValue"}, + "name":"org.apache.shardingsphere.infra.database.firebird.type.FirebirdDatabaseType" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, "name":"org.apache.shardingsphere.infra.database.h2.checker.H2DatabasePrivilegeChecker" @@ -1573,6 +1601,10 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.props.TypedPropertyValue"}, "name":"org.apache.shardingsphere.infra.database.testcontainers.type.TcClickHouseDatabaseType" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.infra.props.TypedPropertyValue"}, + "name":"org.apache.shardingsphere.infra.database.testcontainers.type.TcFirebirdDatabaseType" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.props.TypedPropertyValue"}, "name":"org.apache.shardingsphere.infra.database.testcontainers.type.TcMariaDBDatabaseType" @@ -2072,77 +2104,72 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.deliver.DeliverQualifiedDataSourceSubscriber", - "queryAllDeclaredMethods":true -}, -{ - "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.CacheEvictedSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.CacheEvictedSubscriber", "queryAllDeclaredMethods":true, "methods":[{"name":"cleanCache","parameterTypes":["org.apache.shardingsphere.mode.event.dispatch.DispatchEvent"] }] }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ComputeNodeStateSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.ComputeNodeStateSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.DatabaseDataChangedSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.DatabaseDataChangedSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.GlobalRuleConfigurationEventSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.GlobalRuleConfigurationEventSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ListenerAssistedSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.ListenerAssistedSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.MetaDataChangedSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.MetaDataChangedSubscriber", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.listener.DatabaseMetaDataChangedListener$$Lambda/0x00007faf37cad3a8"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.MetaDataChangedSubscriber" + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.listener.type.DatabaseMetaDataChangedListener$$Lambda/0x00007f1fabcae5b0"}, + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.MetaDataChangedSubscriber" }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ProcessListChangedSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.ProcessListChangedSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.PropertiesEventSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.PropertiesEventSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.QualifiedDataSourceSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.QualifiedDataSourceSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.RuleItemChangedSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.RuleItemChangedSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.StateChangedSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.StateChangedSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.StorageUnitEventSubscriber", + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.StorageUnitEventSubscriber", "queryAllDeclaredMethods":true }, { "condition":{"typeReachable":"org.apache.shardingsphere.mode.persist.PersistServiceFacade"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.persist.ClusterPersistServiceBuilder", + "name":"org.apache.shardingsphere.mode.manager.cluster.persist.builder.ClusterPersistServiceBuilder", "methods":[{"name":"","parameterTypes":[] }] }, { @@ -2155,7 +2182,7 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.mode.persist.PersistServiceFacade"}, - "name":"org.apache.shardingsphere.mode.manager.standalone.persist.StandalonePersistServiceBuilder", + "name":"org.apache.shardingsphere.mode.manager.standalone.persist.builder.StandalonePersistServiceBuilder", "methods":[{"name":"","parameterTypes":[] }] }, { @@ -2454,6 +2481,11 @@ "condition":{"typeReachable":"org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPILoader"}, "name":"org.apache.shardingsphere.readwritesplitting.checker.ReadwriteSplittingRuleConfigurationChecker" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, + "name":"org.apache.shardingsphere.readwritesplitting.cluster.ReadwriteSplittingQualifiedDataSourceDeletedSubscriber", + "queryAllDeclaredMethods":true +}, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, "name":"org.apache.shardingsphere.readwritesplitting.distsql.handler.update.AlterReadwriteSplittingRuleExecutor" @@ -2990,7 +3022,7 @@ "allDeclaredFields":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.StandaloneMetaDataManagerPersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.service.StandaloneMetaDataManagerPersistService"}, "name":"org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration", "allDeclaredFields":true }, @@ -3027,7 +3059,7 @@ "methods":[{"name":"getActualDataNodes","parameterTypes":[] }, {"name":"getAuditStrategy","parameterTypes":[] }, {"name":"getDatabaseStrategy","parameterTypes":[] }, {"name":"getKeyGenerateStrategy","parameterTypes":[] }, {"name":"getLogicTable","parameterTypes":[] }, {"name":"getTableStrategy","parameterTypes":[] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.StandaloneMetaDataManagerPersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.service.StandaloneMetaDataManagerPersistService"}, "name":"org.apache.shardingsphere.sharding.yaml.config.rule.YamlTableRuleConfiguration", "allDeclaredFields":true, "methods":[{"name":"getActualDataNodes","parameterTypes":[] }, {"name":"getAuditStrategy","parameterTypes":[] }, {"name":"getDatabaseStrategy","parameterTypes":[] }, {"name":"getKeyGenerateStrategy","parameterTypes":[] }, {"name":"getLogicTable","parameterTypes":[] }, {"name":"getTableStrategy","parameterTypes":[] }] @@ -3097,7 +3129,7 @@ "methods":[{"name":"getComplex","parameterTypes":[] }, {"name":"getHint","parameterTypes":[] }, {"name":"getNone","parameterTypes":[] }, {"name":"getStandard","parameterTypes":[] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.StandaloneMetaDataManagerPersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.service.StandaloneMetaDataManagerPersistService"}, "name":"org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlShardingStrategyConfiguration", "allDeclaredFields":true, "methods":[{"name":"getComplex","parameterTypes":[] }, {"name":"getHint","parameterTypes":[] }, {"name":"getNone","parameterTypes":[] }, {"name":"getStandard","parameterTypes":[] }] @@ -3218,7 +3250,7 @@ "allDeclaredFields":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.StandaloneMetaDataManagerPersistService"}, + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.persist.service.StandaloneMetaDataManagerPersistService"}, "name":"org.apache.shardingsphere.single.yaml.config.YamlSingleRuleConfiguration", "allDeclaredFields":true }, @@ -3246,6 +3278,11 @@ "condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.core.database.cache.ParseTreeCacheBuilder"}, "name":"org.apache.shardingsphere.sql.parser.core.database.cache.ParseTreeCacheLoader" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.core.database.visitor.SQLStatementVisitorFactory"}, + "name":"org.apache.shardingsphere.sql.parser.firebird.visitor.statement.FirebirdStatementVisitorFacade", + "methods":[{"name":"","parameterTypes":[] }] +}, { "condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.core.database.visitor.SQLStatementVisitorFactory"}, "name":"org.apache.shardingsphere.sql.parser.hive.visitor.statement.HiveStatementVisitorFacade", 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 ea846a4d3982c6..9dc4a1c9dbf01d 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 @@ -3,9 +3,6 @@ "includes":[{ "condition":{"typeReachable":"org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser"}, "pattern":"\\QMETA-INF/dgminfo\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/druid-driver.properties\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser"}, "pattern":"\\QMETA-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule\\E" @@ -21,9 +18,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"}, "pattern":"\\QMETA-INF/seata/io.seata.core.auth.AuthSigner\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/io.seata.core.context.ContextCore\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"}, "pattern":"\\QMETA-INF/seata/io.seata.core.model.ResourceManager\\E" @@ -45,9 +39,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"}, "pattern":"\\QMETA-INF/seata/org.apache.seata.core.auth.AuthSigner\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/org.apache.seata.core.context.ContextCore\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"}, "pattern":"\\QMETA-INF/seata/org.apache.seata.core.model.ResourceManager\\E" @@ -66,9 +57,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.connector.StandardDatabaseConnector"}, "pattern":"\\QMETA-INF/seata/org.apache.seata.rm.datasource.exec.InsertExecutor\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/org.apache.seata.rm.datasource.undo.UndoLogManager\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.connector.StandardDatabaseConnector"}, "pattern":"\\QMETA-INF/seata/org.apache.seata.rm.datasource.undo.UndoLogParser\\E" @@ -87,9 +75,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.connector.StandardDatabaseConnector"}, "pattern":"\\QMETA-INF/seata/org.apache.seata.sqlparser.struct.TableMetaCache\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/seata/org.apache.seata.sqlparser.util.DbTypeParser\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManagerProvider"}, "pattern":"\\QMETA-INF/services/com.atomikos.icatch.TransactionServicePlugin\\E" @@ -106,7 +91,7 @@ "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager"}, "pattern":"\\QMETA-INF/services/com.clickhouse.client.ClickHouseClient\\E" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager$$Lambda/0x00007faf37cb8640"}, + "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.connection.DriverDatabaseConnectionManager$$Lambda/0x00007f1fabcbe0e8"}, "pattern":"\\QMETA-INF/services/com.clickhouse.client.ClickHouseClient\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource"}, @@ -123,9 +108,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"}, "pattern":"\\QMETA-INF/services/io.seata.core.auth.AuthSigner\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/io.seata.core.context.ContextCore\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"}, "pattern":"\\QMETA-INF/services/io.seata.core.model.ResourceManager\\E" @@ -180,9 +162,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"}, "pattern":"\\QMETA-INF/services/org.apache.seata.core.auth.AuthSigner\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/org.apache.seata.core.context.ContextCore\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.initializer.BootstrapInitializer"}, "pattern":"\\QMETA-INF/services/org.apache.seata.core.model.ResourceManager\\E" @@ -201,9 +180,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.connector.StandardDatabaseConnector"}, "pattern":"\\QMETA-INF/services/org.apache.seata.rm.datasource.exec.InsertExecutor\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/org.apache.seata.rm.datasource.undo.UndoLogManager\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.connector.StandardDatabaseConnector"}, "pattern":"\\QMETA-INF/services/org.apache.seata.rm.datasource.undo.UndoLogParser\\E" @@ -222,9 +198,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.connector.StandardDatabaseConnector"}, "pattern":"\\QMETA-INF/services/org.apache.seata.sqlparser.struct.TableMetaCache\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\QMETA-INF/services/org.apache.seata.sqlparser.util.DbTypeParser\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.authority.rule.AuthorityRule"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.authority.spi.PrivilegeProvider\\E" @@ -246,9 +219,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.parse.PostgreSQLComParseExecutor"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.distsql.parser.engine.spi.DistSQLParserFacade\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement"}, - "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.driver.executor.engine.facade.DriverExecutorFacadeFactory\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.infra.algorithm.keygen.core.KeyGenerateAlgorithm\\E" @@ -298,7 +268,7 @@ "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.infra.executor.checker.SQLExecutionChecker\\E" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.Portal"}, + "condition":{"typeReachable":"org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.infra.executor.sql.hook.SQLExecutionHook\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.executor.sql.prepare.AbstractExecutionPrepareEngine"}, @@ -474,9 +444,6 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManagerProvider"}, "pattern":"\\Qjta.properties\\E" - }, { - "condition":{"typeReachable":"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"}, - "pattern":"\\Qlib/sqlparser/druid.jar\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.infra.database.hive.metadata.data.loader.HiveMetaDataLoader"}, "pattern":"\\Qmapred-default.xml\\E" diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json index 4597bf4a5967cb..f6b28429413e30 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json @@ -239,8 +239,8 @@ "allPublicMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"}, - "name":"org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.MetaDataChangedSubscriber", + "condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.listener.type.DatabaseMetaDataChangedListener"}, + "name":"org.apache.shardingsphere.mode.manager.cluster.event.dispatch.subscriber.type.MetaDataChangedSubscriber", "allPublicMethods":true }, { diff --git a/pom.xml b/pom.xml index cb4f22033b5766..c22fa61b267b0f 100644 --- a/pom.xml +++ b/pom.xml @@ -154,7 +154,7 @@ 0.6.1 1.4.13 0.3.1 - 0.10.3 + 0.10.4 1.0.0 diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/hive/ZookeeperServiceDiscoveryTest.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/hive/ZookeeperServiceDiscoveryTest.java index 9bcaf48dc3a161..8123ef8a8a0c31 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/hive/ZookeeperServiceDiscoveryTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/hive/ZookeeperServiceDiscoveryTest.java @@ -65,11 +65,10 @@ class ZookeeperServiceDiscoveryTest { .withExposedPorts(2181); /** - * TODO Maybe we should be able to find a better solution than {@link InstanceSpec#getRandomPort()} to use a random available port on the host. - * It is not a good practice to use {@link FixedHostPortGenericContainer}. - * See testcontainers/testcontainers-java#9553 . + * Due to the design flaw of testcontainers-java, + * starting HiveServer2 using Zookeeper service discovery can only be done through the deprecated {@link FixedHostPortGenericContainer}. + * See testcontainers/testcontainers-java#9553. */ - @SuppressWarnings("unused") @Container private static final GenericContainer HS2_1_CONTAINER = new FixedHostPortGenericContainer<>("apache/hive:4.0.1") .withNetwork(NETWORK) @@ -105,11 +104,6 @@ static void afterAll() { System.clearProperty(SYSTEM_PROP_KEY_PREFIX + "ds2.jdbc-url"); } - /** - * TODO Same problem {@link InstanceSpec#getRandomPort()} as {@code HIVE_SERVER2_1_CONTAINER}. - * - * @throws SQLException SQL exception. - */ @Test void assertShardingInLocalTransactions() throws SQLException { jdbcUrlPrefix = "jdbc:hive2://" + ZOOKEEPER_CONTAINER.getHost() + ":" + ZOOKEEPER_CONTAINER.getMappedPort(2181) + "/";