You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/04/09 13:39:45 UTC

[shardingsphere] branch master updated: Refactor GlobalRuleBuilder (#10014)

This is an automated email from the ASF dual-hosted git repository.

panjuan 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 0fb07f5  Refactor GlobalRuleBuilder (#10014)
0fb07f5 is described below

commit 0fb07f502936cc4d48a1517e8d5d310a2a76357f
Author: Liang Zhang <te...@163.com>
AuthorDate: Fri Apr 9 21:39:09 2021 +0800

    Refactor GlobalRuleBuilder (#10014)
---
 .../shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java   | 2 +-
 .../apache/shardingsphere/infra/rule/builder/GlobalRuleBuilder.java   | 4 ++--
 .../shardingsphere/infra/rule/builder/ShardingSphereRulesBuilder.java | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/shardingsphere-features/shardingsphere-authority/shardingsphere-authority-common/src/main/java/org/apache/shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java b/shardingsphere-features/shardingsphere-authority/shardingsphere-authority-common/src/main/java/org/apache/shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java
index 5ebc416..9a48265 100644
--- a/shardingsphere-features/shardingsphere-authority/shardingsphere-authority-common/src/main/java/org/apache/shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-authority/shardingsphere-authority-common/src/main/java/org/apache/shardingsphere/authority/rule/builder/AuthorityRuleBuilder.java
@@ -33,7 +33,7 @@ import java.util.Map;
 public final class AuthorityRuleBuilder implements GlobalRuleBuilder<AuthorityRule, AuthorityRuleConfiguration> {
     
     @Override
-    public AuthorityRule build(final Map<String, ShardingSphereMetaData> mataDataMap, final AuthorityRuleConfiguration ruleConfig, final Collection<ShardingSphereUser> users) {
+    public AuthorityRule build(final AuthorityRuleConfiguration ruleConfig, final Map<String, ShardingSphereMetaData> mataDataMap, final Collection<ShardingSphereUser> users) {
         return new AuthorityRule(ruleConfig, mataDataMap, users);
     }
     
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/GlobalRuleBuilder.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/GlobalRuleBuilder.java
index 6fe891b..205e1c8 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/GlobalRuleBuilder.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/GlobalRuleBuilder.java
@@ -37,10 +37,10 @@ public interface GlobalRuleBuilder<R extends GlobalRule, T extends RuleConfigura
     /**
      * Build global rule.
      *
-     * @param mataDataMap mata data map
      * @param ruleConfig rule configuration
+     * @param mataDataMap mata data map
      * @param users users
      * @return global rule
      */
-    R build(Map<String, ShardingSphereMetaData> mataDataMap, T ruleConfig, Collection<ShardingSphereUser> users);
+    R build(T ruleConfig, Map<String, ShardingSphereMetaData> mataDataMap, Collection<ShardingSphereUser> users);
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/ShardingSphereRulesBuilder.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/ShardingSphereRulesBuilder.java
index bc2470c..bead359 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/ShardingSphereRulesBuilder.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/ShardingSphereRulesBuilder.java
@@ -75,7 +75,7 @@ public final class ShardingSphereRulesBuilder {
         Map<RuleConfiguration, GlobalRuleBuilder> builders = OrderedSPIRegistry.getRegisteredServices(globalRuleConfigurations, GlobalRuleBuilder.class);
         Collection<ShardingSphereRule> result = new LinkedList<>();
         for (Entry<RuleConfiguration, GlobalRuleBuilder> entry : builders.entrySet()) {
-            result.add(entry.getValue().build(mataDataMap, entry.getKey(), users));
+            result.add(entry.getValue().build(entry.getKey(), mataDataMap, users));
         }
         return result;
     }