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 2090365  Remove rule checker in SchemaRulePersistService (#12290)
2090365 is described below

commit 2090365b0076b05f6b001f2d487f8e02c8a77d14
Author: Haoran Meng <[email protected]>
AuthorDate: Wed Sep 8 16:57:06 2021 +0800

    Remove rule checker in SchemaRulePersistService (#12290)
---
 .../mode/persist/service/impl/SchemaRulePersistService.java  | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git 
a/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/persist/service/impl/SchemaRulePersistService.java
 
b/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/persist/service/impl/SchemaRulePersistService.java
index be616fd..1f87f54 100644
--- 
a/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/persist/service/impl/SchemaRulePersistService.java
+++ 
b/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/persist/service/impl/SchemaRulePersistService.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.mode.persist.service.impl;
 import com.google.common.base.Strings;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.infra.config.RuleConfiguration;
-import 
org.apache.shardingsphere.infra.config.checker.RuleConfigurationCheckerFactory;
 import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRuleConfiguration;
 import 
org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapperEngine;
 import org.apache.shardingsphere.infra.yaml.engine.YamlEngine;
@@ -48,17 +47,12 @@ public final class SchemaRulePersistService implements 
SchemaBasedPersistService
     
     @Override
     public void persist(final String schemaName, final 
Collection<RuleConfiguration> configs) {
-        repository.persist(SchemaMetadataNode.getRulePath(schemaName), 
YamlEngine.marshal(createYamlRuleConfigurations(schemaName, configs)));
+        repository.persist(SchemaMetadataNode.getRulePath(schemaName), 
YamlEngine.marshal(createYamlRuleConfigurations(configs)));
     }
     
     @SuppressWarnings("unchecked")
-    private Collection<YamlRuleConfiguration> 
createYamlRuleConfigurations(final String schemaName, final 
Collection<RuleConfiguration> ruleConfigs) {
-        Collection<RuleConfiguration> configs = new LinkedList<>();
-        for (RuleConfiguration each : ruleConfigs) {
-            
RuleConfigurationCheckerFactory.newInstance(each).ifPresent(checker -> 
checker.check(schemaName, each));
-            configs.add(each);
-        }
-        return new 
YamlRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(configs);
+    private Collection<YamlRuleConfiguration> 
createYamlRuleConfigurations(final Collection<RuleConfiguration> ruleConfigs) {
+        return new 
YamlRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(ruleConfigs);
     }
     
     @Override

Reply via email to