-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add separate documentation for ShardingSphereDriver's URL configurati…
…on (#29730)
- Loading branch information
1 parent
a9cc771
commit 849cc42
Showing
8 changed files
with
102 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...l/shardingsphere-jdbc/yaml-config/jdbc-driver/known-implementation/_index.cn.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
+++ | ||
title = "已知实现" | ||
weight = 4 | ||
chapter = true | ||
+++ | ||
|
||
## 背景信息 | ||
|
||
对于 `org.apache.shardingsphere.driver.ShardingSphereDriver` 的驱动类, | ||
通过实现 `org.apache.shardingsphere.driver.jdbc.core.driver.ShardingSphereURLProvider` 的 SPI, | ||
可允许从多种来源和 File System 获取并解析为 ShardingSphere 的 YAML 配置文件。 | ||
|
||
在解析并加载 YAML 文件为 ShardingSphere 的元数据后, | ||
会再次通过[模式配置](../../../java-api/mode.cn.md)的相关配置决定下一步行为。讨论两种情况: | ||
1. 元数据持久化仓库中不存在 ShardingSphere 的元数据,本地元数据将被存储到元数据持久化仓库。 | ||
2. 元数据持久化仓库中已存在与本地元数据不同的 ShardingSphere 的元数据,本地元数据将被元数据持久化仓库的元数据覆盖。 | ||
|
||
对元数据持久化仓库的配置需参考[元数据持久化仓库](../../../../common-config/builtin-algorithm/metadata-repository.cn.md)。 | ||
|
||
## URL 配置 | ||
|
||
### 从类路径中加载配置文件 | ||
加载 classpath 中 config.yaml 配置文件的 JDBC URL,通过 `jdbc:shardingsphere:classpath:` 前缀识别。 | ||
配置文件为 `xxx.yaml`,配置文件格式与 [YAML 配置](../../../yaml-config)一致。 | ||
|
||
用例: | ||
- `jdbc:shardingsphere:classpath:config.yaml` | ||
|
||
### 从绝对路径中加载配置文件 | ||
加载绝对路径中 config.yaml 配置文件的 JDBC URL,通过 `jdbc:shardingsphere:absolutepath:` 前缀识别。 | ||
配置文件为 `xxx.yaml`,配置文件格式与 [YAML 配置](../../../yaml-config)一致。 | ||
|
||
用例: | ||
- `jdbc:shardingsphere:absolutepath:/path/to/config.yaml` | ||
|
||
### 其他实现 | ||
具体可参考 https://github.com/apache/shardingsphere-plugin 。 |
37 changes: 37 additions & 0 deletions
37
...l/shardingsphere-jdbc/yaml-config/jdbc-driver/known-implementation/_index.en.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
+++ | ||
title = "Known Implementation" | ||
weight = 4 | ||
chapter = true | ||
+++ | ||
|
||
## Background Information | ||
|
||
For the driver class of `org.apache.shardingsphere.driver.ShardingSphereDriver`, | ||
by implementing the SPI of `org.apache.shardingsphere.driver.jdbc.core.driver.ShardingSphereURLProvider`, | ||
allows YAML configuration files to be fetched from multiple sources and File Systems and parsed into ShardingSphere. | ||
|
||
After parsing and loading the YAML file into ShardingSphere's metadata, | ||
The next behavior will be determined again through the relevant configuration of [Mode Configuration](../../../java-api/mode.cn.md). Discuss two situations: | ||
1. ShardingSphere’s metadata does not exist in the metadata persistence warehouse, and local metadata will be stored in the metadata persistence warehouse. | ||
2. Metadata of ShardingSphere that is different from local metadata already exists in the metadata persistence warehouse, and the local metadata will be overwritten by the metadata of the metadata persistence warehouse. | ||
|
||
For the configuration of the metadata persistence warehouse, please refer to [Metadata Persistence Warehouse](../../../../common-config/builtin-algorithm/metadata-repository.cn.md). | ||
|
||
## URL configuration | ||
|
||
### Load configuration files from classpath | ||
Load the JDBC URL of the config.yaml configuration file in classpath, identified by the `jdbc:shardingsphere:classpath:` prefix. | ||
The configuration file is `xxx.yaml`, and the configuration file format is consistent with [YAML configuration](../../../yaml-config). | ||
|
||
Example: | ||
- `jdbc:shardingsphere:classpath:config.yaml` | ||
|
||
### Load configuration file from absolute path | ||
JDBC URL to load the config.yaml configuration file in an absolute path, identified by the `jdbc:shardingsphere:absolutepath:` prefix. | ||
The configuration file is `xxx.yaml`, and the configuration file format is consistent with [YAML configuration](../../../yaml-config). | ||
|
||
Example: | ||
- `jdbc:shardingsphere:absolutepath:/path/to/config.yaml` | ||
|
||
### Other implementations | ||
For details, please refer to https://github.com/apache/shardingsphere-plugin . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters