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 2020/10/04 12:21:36 UTC

[shardingsphere] branch master updated: Simplify AlgorithmProvidedShardingRuleConfiguration (#7700)

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 8d50ae4  Simplify AlgorithmProvidedShardingRuleConfiguration (#7700)
8d50ae4 is described below

commit 8d50ae46434c80e403f60afa386941e8c95717e0
Author: Liang Zhang <te...@163.com>
AuthorDate: Sun Oct 4 20:21:13 2020 +0800

    Simplify AlgorithmProvidedShardingRuleConfiguration (#7700)
---
 ...AlgorithmProvidedShardingRuleConfiguration.java | 36 ++++++----------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/config/AlgorithmProvidedShardingRuleConfiguration.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/config/AlgorithmProvidedShardingRuleConfiguration.java
index 7f4e1fa..c388d74 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/config/AlgorithmProvidedShardingRuleConfiguration.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/config/AlgorithmProvidedShardingRuleConfiguration.java
@@ -17,11 +17,9 @@
 
 package org.apache.shardingsphere.sharding.algorithm.config;
 
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.Map;
+import lombok.AllArgsConstructor;
 import lombok.Getter;
+import lombok.NoArgsConstructor;
 import lombok.Setter;
 import org.apache.shardingsphere.infra.config.RuleConfiguration;
 import org.apache.shardingsphere.sharding.api.config.rule.ShardingAutoTableRuleConfiguration;
@@ -31,9 +29,16 @@ import org.apache.shardingsphere.sharding.api.config.strategy.sharding.ShardingS
 import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm;
 import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
 
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.Map;
+
 /**
  * Algorithm provided sharding rule configuration.
  */
+@NoArgsConstructor
+@AllArgsConstructor
 @Getter
 @Setter
 public final class AlgorithmProvidedShardingRuleConfiguration implements RuleConfiguration {
@@ -55,27 +60,4 @@ public final class AlgorithmProvidedShardingRuleConfiguration implements RuleCon
     private Map<String, ShardingAlgorithm> shardingAlgorithms = new LinkedHashMap<>();
     
     private Map<String, KeyGenerateAlgorithm> keyGenerators = new LinkedHashMap<>();
-    
-    public AlgorithmProvidedShardingRuleConfiguration() {
-    }
-    
-    public AlgorithmProvidedShardingRuleConfiguration(final Collection<ShardingTableRuleConfiguration> tables,
-                                                      final Collection<ShardingAutoTableRuleConfiguration> autoTables,
-                                                      final Collection<String> bindingTableGroups,
-                                                      final Collection<String> broadcastTables,
-                                                      final ShardingStrategyConfiguration defaultDatabaseShardingStrategy,
-                                                      final ShardingStrategyConfiguration defaultTableShardingStrategy,
-                                                      final KeyGenerateStrategyConfiguration defaultKeyGenerateStrategy,
-                                                      final Map<String, ShardingAlgorithm> shardingAlgorithms,
-                                                      final Map<String, KeyGenerateAlgorithm> keyGenerators) {
-        this.tables = tables;
-        this.autoTables = autoTables;
-        this.bindingTableGroups = bindingTableGroups;
-        this.broadcastTables = broadcastTables;
-        this.defaultDatabaseShardingStrategy = defaultDatabaseShardingStrategy;
-        this.defaultTableShardingStrategy = defaultTableShardingStrategy;
-        this.defaultKeyGenerateStrategy = defaultKeyGenerateStrategy;
-        this.shardingAlgorithms = shardingAlgorithms;
-        this.keyGenerators = keyGenerators;
-    }
 }