You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2022/06/25 23:17:15 UTC
[shardingsphere] branch master updated: Refactor ExportDatabaseConfigurationHandler (#18595)
This is an automated email from the ASF dual-hosted git repository.
menghaoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 7297c9ff61b Refactor ExportDatabaseConfigurationHandler (#18595)
7297c9ff61b is described below
commit 7297c9ff61bb187599042c380448111129ff6a1b
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun Jun 26 07:17:06 2022 +0800
Refactor ExportDatabaseConfigurationHandler (#18595)
---
.../ral/common/queryable/ExportDatabaseConfigurationHandler.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ExportDatabaseConfigurationHandler.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ExportDatabaseConfigurationHandler.java
index 2b1717db9c8..41a7430fdba 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ExportDatabaseConfigurationHandler.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ExportDatabaseConfigurationHandler.java
@@ -112,13 +112,13 @@ public final class ExportDatabaseConfigurationHandler extends QueryableRALBacken
}
stringBuilder.append("rules").append(":\n");
for (Entry<RuleConfiguration, YamlRuleConfigurationSwapper> entry : YamlRuleConfigurationSwapperFactory.getInstanceMapByRuleConfigurations(ruleConfigs).entrySet()) {
- String actual = YamlEngine.marshal(Collections.singleton(entry.getValue().swapToYamlConfiguration(entry.getKey())), Tag.MAP);
- stringBuilder.append(rulesConfigKeywordReplace(actual));
+ String content = YamlEngine.marshal(Collections.singleton(entry.getValue().swapToYamlConfiguration(entry.getKey())), Tag.MAP);
+ stringBuilder.append(replaceKeywordsOfRulesConfiguration(content));
}
}
- private String rulesConfigKeywordReplace(final String rulesConfig) {
- return rulesConfig.replace("? ", "- ").replace(": null\n", "");
+ private String replaceKeywordsOfRulesConfiguration(final String ruleConfigsContent) {
+ return ruleConfigsContent.replace("? ", "- ").replace(": null\n", "");
}
@SuppressWarnings("ResultOfMethodCallIgnored")