diff --git a/docs/document/content/user-manual/common-config/builtin-algorithm/metadata-repository.cn.md b/docs/document/content/user-manual/common-config/builtin-algorithm/metadata-repository.cn.md index b1b499b4be579..733ae7aa62499 100644 --- a/docs/document/content/user-manual/common-config/builtin-algorithm/metadata-repository.cn.md +++ b/docs/document/content/user-manual/common-config/builtin-algorithm/metadata-repository.cn.md @@ -11,31 +11,13 @@ Apache ShardingSphere 为不同的运行模式提供了不同的元数据持久 ### 数据库持久化 -`provider` 的可选值为 H2,MySQL,EmbeddedDerby,DerbyNetworkServer,HSQLDB。 +`provider` 的可选值为 H2,MySQL 和 HSQLDB。 由于第三方的 Vulnerability Report 时常误报 H2 Database,避免在 ShardingSphere Standalone Mode 使用 H2 Database 可能是一种选择。 讨论 `provider` 不为默认值 `H2` 的情况。 1. 若 `provider` 设置为 `MySQL`,则要求存在已就绪的 MySQL Server。classpath 应包含 `com.mysql:mysql-connector-j:9.0.0` 的 Maven 依赖。 -2. 若 `provider` 设置为 `EmbeddedDerby`,则 Derby 数据库引擎将在与应用程序相同的 JVM 内运行。 -classpath 应包含 `org.apache.derby:derby:10.17.1.0` 和 `org.apache.derby:derbytools:10.17.1.0` 的 Maven 依赖, -且要求编译或运行下游项目的 JDK 版本大于或等于 JDK19。可能的配置如下。 -```yaml -mode: - type: Standalone - repository: - type: JDBC - props: - provider: EmbeddedDerby - jdbc_url: jdbc:derby:memory:config;create=true - username: -``` - -3. 若 `provider` 设置为 `DerbyNetworkServer`,则要求存在已就绪的 Derby Network Server。 -Derby Network Server 不存在可用的 Docker Image,用户可能需要手动启动 Derby Network Server。 -classpath 应包含 `org.apache.derby:derbyclient:10.17.1.0` 和 `org.apache.derby:derbytools:10.17.1.0` 的 Maven 依赖, -且要求编译或运行下游项目的 JDK 版本大于或等于 JDK19。 -4. 若 `provider` 设置为 `HSQLDB`,则要求存在已就绪的采用 Server Modes 的 HyperSQL,或以 in-process database 的方式创建数据库。 +2. 若 `provider` 设置为 `HSQLDB`,则要求存在已就绪的采用 Server Modes 的 HyperSQL,或以 in-process database 的方式创建数据库。 classpath 应包含 `classifier` 为 `jdk8` 的 `org.hsqldb:hsqldb:2.7.3` 的 Maven 依赖。 采用 Server Modes 的 HyperSQL 不存在可用的 Docker Image,用户可能需要手动启动 Server Modes 的 HyperSQL。 若使用 mem: protocol 的 HyperSQL,则可能的配置如下, diff --git a/docs/document/content/user-manual/common-config/builtin-algorithm/metadata-repository.en.md b/docs/document/content/user-manual/common-config/builtin-algorithm/metadata-repository.en.md index 530d0cabccf33..770acd63c35d5 100644 --- a/docs/document/content/user-manual/common-config/builtin-algorithm/metadata-repository.en.md +++ b/docs/document/content/user-manual/common-config/builtin-algorithm/metadata-repository.en.md @@ -11,31 +11,13 @@ Apache ShardingSphere provides different metadata persistence methods for differ ### Database Repository -The optional values of `provider` are H2, MySQL, EmbeddedDerby, DerbyNetworkServer and HSQLDB. +The optional values of `provider` are H2, MySQL and HSQLDB. Since third-party Vulnerability Reports often misreport H2 Database, avoiding the use of H2 Database in ShardingSphere Standalone Mode may be an option. Discuss the case where `provider` is not the default value `H2`. 1. If `provider` is set to `MySQL`, a ready MySQL Server is required. The classpath should contain the Maven dependency of `com.mysql:mysql-connector-j:9.0.0`. -2. If `provider` is set to `EmbeddedDerby`, the Derby database engine will run in the same JVM as the application. - The classpath should contain Maven dependencies of `org.apache.derby:derby:10.17.1.0` and `org.apache.derby:derbytools:10.17.1.0`, - and the JDK version required to compile or run the downstream project is greater than or equal to JDK19. Possible configurations are as follows. -```yaml -mode: - type: Standalone - repository: - type: JDBC - props: - provider: EmbeddedDerby - jdbc_url: jdbc:derby:memory:config;create=true - username: -``` - -3. If `provider` is set to `DerbyNetworkServer`, a ready Derby Network Server is required. - There is no available Docker Image for Derby Network Server, and users may need to start Derby Network Server manually. - The classpath should contain Maven dependencies of `org.apache.derby:derbyclient:10.17.1.0` and `org.apache.derby:derbytools:10.17.1.0`, - and the JDK version required to compile or run the downstream project is greater than or equal to JDK19. -4. If `provider` is set to `HSQLDB`, a ready HyperSQL using Server Modes is required, or a database is created as an in-process database. +2. If `provider` is set to `HSQLDB`, a ready HyperSQL using Server Modes is required, or a database is created as an in-process database. The classpath should contain the Maven dependency of `org.hsqldb:hsqldb:2.7.3` with `classifier` as `jdk8`. There is no available Docker Image for HyperSQL using Server Modes, and users may need to manually start HyperSQL using Server Modes. If HyperSQL using mem: protocol is used, the possible configuration is as follows, diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json index 6d084fa4ce0c9..0ee3e37d22c4b 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json @@ -11598,18 +11598,6 @@ }, "glob": "sql" }, - { - "condition": { - "typeReached": "org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader" - }, - "glob": "sql/DerbyNetworkServer.xml" - }, - { - "condition": { - "typeReached": "org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader" - }, - "glob": "sql/EmbeddedDerby.xml" - }, { "condition": { "typeReached": "org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader" diff --git a/mode/type/standalone/repository/provider/jdbc/src/main/resources/sql/DerbyNetworkServer.xml b/mode/type/standalone/repository/provider/jdbc/src/main/resources/sql/DerbyNetworkServer.xml deleted file mode 100644 index a5213295efe26..0000000000000 --- a/mode/type/standalone/repository/provider/jdbc/src/main/resources/sql/DerbyNetworkServer.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CREATE TABLE repository(id varchar(36) PRIMARY KEY, "key" varchar(32672), value varchar(32672), parent varchar(32672)) - SELECT value FROM repository WHERE "key" = ? - SELECT DISTINCT("key") FROM repository WHERE parent = ? - INSERT INTO repository VALUES(?, ?, ?, ?) - UPDATE repository SET value = ? WHERE "key" = ? - DELETE FROM repository WHERE "key" LIKE ? - diff --git a/mode/type/standalone/repository/provider/jdbc/src/main/resources/sql/EmbeddedDerby.xml b/mode/type/standalone/repository/provider/jdbc/src/main/resources/sql/EmbeddedDerby.xml deleted file mode 100644 index 7c517f33f9473..0000000000000 --- a/mode/type/standalone/repository/provider/jdbc/src/main/resources/sql/EmbeddedDerby.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CREATE TABLE repository(id varchar(36) PRIMARY KEY, "key" varchar(32672), value varchar(32672), parent varchar(32672)) - SELECT value FROM repository WHERE "key" = ? - SELECT DISTINCT("key") FROM repository WHERE parent = ? - INSERT INTO repository VALUES(?, ?, ?, ?) - UPDATE repository SET value = ? WHERE "key" = ? - DELETE FROM repository WHERE "key" LIKE ? - diff --git a/mode/type/standalone/repository/provider/jdbc/src/test/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoaderTest.java b/mode/type/standalone/repository/provider/jdbc/src/test/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoaderTest.java index b9eeb7a9e6b4b..d343d4e5f933e 100644 --- a/mode/type/standalone/repository/provider/jdbc/src/test/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoaderTest.java +++ b/mode/type/standalone/repository/provider/jdbc/src/test/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoaderTest.java @@ -27,8 +27,6 @@ class JDBCRepositorySQLLoaderTest { @Test void assertLoad() { assertThat(JDBCRepositorySQLLoader.load("MySQL").getType(), is("MySQL")); - assertThat(JDBCRepositorySQLLoader.load("EmbeddedDerby").getType(), is("EmbeddedDerby")); - assertThat(JDBCRepositorySQLLoader.load("DerbyNetworkServer").getType(), is("DerbyNetworkServer")); assertThat(JDBCRepositorySQLLoader.load("HSQLDB").getType(), is("HSQLDB")); }