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/31 14:59:50 UTC

[shardingsphere] branch master updated: Use SPI to config property keys for converting sharding algorithm in RDL (#7996)

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 582676d  Use SPI to config property keys for converting sharding algorithm in RDL (#7996)
582676d is described below

commit 582676d00f04142bcdc19e94ee4850f97e4e7a97
Author: Liang Zhang <te...@163.com>
AuthorDate: Sat Oct 31 22:59:23 2020 +0800

    Use SPI to config property keys for converting sharding algorithm in RDL (#7996)
    
    * Add ShardingSphereAlgorithmPropertiesAware
    
    * Use SPI to config property keys for converting sharding algorithm in RDL
    
    * Fix test case
---
 .../api/sharding/ShardingAutoTableAlgorithm.java   |  7 ++-
 .../datetime/AutoIntervalShardingAlgorithm.java    |  6 ++
 .../sharding/mod/HashModShardingAlgorithm.java     |  6 ++
 .../sharding/mod/ModShardingAlgorithm.java         |  6 ++
 .../range/BoundaryBasedRangeShardingAlgorithm.java |  8 +++
 .../range/VolumeBasedRangeShardingAlgorithm.java   |  7 +++
 ...reateShardingRuleStatementContextConverter.java | 34 +++++++++--
 ...eShardingRuleStatementContextConverterTest.java |  3 +
 .../rdl/CreateShardingRuleStatementContext.java    | 14 -----
 .../rdl/util/ShardingAlgorithmPropertiesUtil.java  | 71 ----------------------
 .../ShardingSphereAlgorithmPropertiesAware.java    | 19 +++---
 11 files changed, 80 insertions(+), 101 deletions(-)

diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/sharding/ShardingAutoTableAlgorithm.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/sharding/ShardingAutoTableAlgorithm.java
index 6fa8015..99df540 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/sharding/ShardingAutoTableAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/sharding/ShardingAutoTableAlgorithm.java
@@ -17,12 +17,13 @@
 
 package org.apache.shardingsphere.sharding.api.sharding;
 
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmPropertiesAware;
+
 /**
  * Sharding auto table algorithm.
- *
  */
-public interface ShardingAutoTableAlgorithm {
-
+public interface ShardingAutoTableAlgorithm extends ShardingSphereAlgorithmPropertiesAware {
+    
     /**
      * Get auto tables amount.
      *
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/AutoIntervalShardingAlgorithm.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/AutoIntervalShardingAlgorithm.java
index 873dd75..35e0ae6 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/AutoIntervalShardingAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/AutoIntervalShardingAlgorithm.java
@@ -32,6 +32,7 @@ import java.time.Duration;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeParseException;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.LinkedHashSet;
 import java.util.Properties;
@@ -131,4 +132,9 @@ public final class AutoIntervalShardingAlgorithm implements StandardShardingAlgo
     public String getType() {
         return "AUTO_INTERVAL";
     }
+    
+    @Override
+    public Collection<String> getAllPropertyKeys() {
+        return Arrays.asList(DATE_TIME_LOWER_KEY, DATE_TIME_UPPER_KEY, SHARDING_SECONDS_KEY);
+    }
 }
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/HashModShardingAlgorithm.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/HashModShardingAlgorithm.java
index 5557998..6162928 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/HashModShardingAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/HashModShardingAlgorithm.java
@@ -26,6 +26,7 @@ import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingVal
 import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Properties;
 
 /**
@@ -79,4 +80,9 @@ public final class HashModShardingAlgorithm implements StandardShardingAlgorithm
     public String getType() {
         return "HASH_MOD";
     }
+    
+    @Override
+    public Collection<String> getAllPropertyKeys() {
+        return Collections.singletonList(SHARDING_COUNT_KEY);
+    }
 }
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java
index 19f23ff..c181c9a 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java
@@ -26,6 +26,7 @@ import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingVal
 import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.LinkedHashSet;
 import java.util.Properties;
 
@@ -97,4 +98,9 @@ public final class ModShardingAlgorithm implements StandardShardingAlgorithm<Com
     public String getType() {
         return "MOD";
     }
+    
+    @Override
+    public Collection<String> getAllPropertyKeys() {
+        return Collections.singletonList(SHARDING_COUNT_KEY);
+    }
 }
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/range/BoundaryBasedRangeShardingAlgorithm.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/range/BoundaryBasedRangeShardingAlgorithm.java
index 6faf85c..839582c 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/range/BoundaryBasedRangeShardingAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/range/BoundaryBasedRangeShardingAlgorithm.java
@@ -23,6 +23,9 @@ import com.google.common.collect.Maps;
 import com.google.common.collect.Range;
 import com.google.common.primitives.Longs;
 import org.apache.commons.collections4.CollectionUtils;
+
+import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -62,4 +65,9 @@ public final class BoundaryBasedRangeShardingAlgorithm extends AbstractRangeShar
     public String getType() {
         return "BOUNDARY_RANGE";
     }
+    
+    @Override
+    public Collection<String> getAllPropertyKeys() {
+        return Collections.singletonList(SHARDING_RANGES_KEY);
+    }
 }
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/range/VolumeBasedRangeShardingAlgorithm.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/range/VolumeBasedRangeShardingAlgorithm.java
index 6871da2..713e8ac 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/range/VolumeBasedRangeShardingAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/range/VolumeBasedRangeShardingAlgorithm.java
@@ -23,6 +23,8 @@ import com.google.common.collect.Range;
 import com.google.common.math.LongMath;
 
 import java.math.RoundingMode;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Map;
 import java.util.Properties;
 
@@ -60,4 +62,9 @@ public final class VolumeBasedRangeShardingAlgorithm extends AbstractRangeShardi
     public String getType() {
         return "VOLUME_RANGE";
     }
+    
+    @Override
+    public Collection<String> getAllPropertyKeys() {
+        return Arrays.asList(RANGE_LOWER_KEY, RANGE_UPPER_KEY, SHARDING_VOLUME_KEY);
+    }
 }
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/converter/CreateShardingRuleStatementContextConverter.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/converter/CreateShardingRuleStatementContextConverter.java
index 905ecea..52a32d9 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/converter/CreateShardingRuleStatementContextConverter.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/converter/CreateShardingRuleStatementContextConverter.java
@@ -18,15 +18,23 @@
 package org.apache.shardingsphere.sharding.converter;
 
 import com.google.common.base.Joiner;
-import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.binder.statement.rdl.CreateShardingRuleStatementContext;
-import org.apache.shardingsphere.infra.binder.converter.SQLStatementContextConverter;
+import com.google.common.base.Preconditions;
 import org.apache.shardingsphere.distsql.parser.statement.rdl.TableRuleSegment;
+import org.apache.shardingsphere.infra.binder.converter.SQLStatementContextConverter;
+import org.apache.shardingsphere.infra.binder.statement.rdl.CreateShardingRuleStatementContext;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmPropertiesAware;
+import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
+import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
+import org.apache.shardingsphere.sharding.api.sharding.ShardingAutoTableAlgorithm;
+import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
 import org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration;
 import org.apache.shardingsphere.sharding.yaml.config.rule.YamlShardingAutoTableRuleConfiguration;
 import org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlShardingStrategyConfiguration;
 import org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlStandardShardingStrategyConfiguration;
 
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
 import java.util.Properties;
 
 /**
@@ -39,7 +47,7 @@ public final class CreateShardingRuleStatementContextConverter implements SQLSta
         YamlShardingRuleConfiguration result = new YamlShardingRuleConfiguration();
         for (TableRuleSegment each : sqlStatementContext.getSqlStatement().getTables()) {
             result.getShardingAlgorithms().put(getAlgorithmName(each.getLogicTable(), each.getAlgorithmType()),
-                    createAlgorithmConfiguration(each, sqlStatementContext.getAlgorithmProperties(each)));
+                    createAlgorithmConfiguration(each, getAlgorithmProperties(each.getAlgorithmType(), each.getProperties())));
             result.getAutoTables().put(each.getLogicTable(), createAutoTableRuleConfiguration(each));
         }
         return result;
@@ -52,6 +60,24 @@ public final class CreateShardingRuleStatementContextConverter implements SQLSta
         return result;
     }
     
+    private Properties getAlgorithmProperties(final String type, final Collection<String> propertyValues) {
+        Collection<String> propertyKeys = findAlgorithmPropertyKeys(type);
+        Preconditions.checkArgument(propertyKeys.size() == propertyValues.size(), "%s needs %d properties, but %s properties are given.", type, propertyKeys.size(), propertyValues.size());
+        Properties result = new Properties();
+        Iterator<String> keys = propertyKeys.iterator();
+        Iterator<String> values = propertyValues.iterator();
+        while (keys.hasNext()) {
+            result.setProperty(keys.next(), values.next());
+        }
+        return result;
+    }
+    
+    private Collection<String> findAlgorithmPropertyKeys(final String algorithmType) {
+        return ShardingSphereServiceLoader.newServiceInstances(ShardingAlgorithm.class).stream()
+                .filter(each -> each instanceof ShardingAutoTableAlgorithm && each.getType().equals(algorithmType)).findFirst()
+                .map(each -> ((ShardingSphereAlgorithmPropertiesAware) each).getAllPropertyKeys()).orElse(Collections.emptyList());
+    }
+    
     private YamlShardingAutoTableRuleConfiguration createAutoTableRuleConfiguration(final TableRuleSegment segment) {
         YamlShardingAutoTableRuleConfiguration result = new YamlShardingAutoTableRuleConfiguration();
         result.setLogicTable(segment.getLogicTable());
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/converter/CreateShardingRuleStatementContextConverterTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/converter/CreateShardingRuleStatementContextConverterTest.java
index 59a034a..39362d7 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/converter/CreateShardingRuleStatementContextConverterTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/converter/CreateShardingRuleStatementContextConverterTest.java
@@ -20,6 +20,8 @@ package org.apache.shardingsphere.sharding.converter;
 import org.apache.shardingsphere.infra.binder.statement.rdl.CreateShardingRuleStatementContext;
 import org.apache.shardingsphere.distsql.parser.statement.rdl.CreateShardingRuleStatement;
 import org.apache.shardingsphere.distsql.parser.statement.rdl.TableRuleSegment;
+import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
+import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
 import org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration;
 import org.junit.Before;
 import org.junit.Test;
@@ -39,6 +41,7 @@ public final class CreateShardingRuleStatementContextConverterTest {
     
     @Before
     public void setUp() {
+        ShardingSphereServiceLoader.register(ShardingAlgorithm.class);
         segment = new TableRuleSegment();
         segment.setLogicTable("t_order");
         segment.setDataSources(Arrays.asList("ds0", "ds1"));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/rdl/CreateShardingRuleStatementContext.java b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/rdl/CreateShardingRuleStatementContext.java
index a86a35a..b88e676 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/rdl/CreateShardingRuleStatementContext.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/rdl/CreateShardingRuleStatementContext.java
@@ -18,11 +18,7 @@
 package org.apache.shardingsphere.infra.binder.statement.rdl;
 
 import org.apache.shardingsphere.distsql.parser.statement.rdl.CreateShardingRuleStatement;
-import org.apache.shardingsphere.distsql.parser.statement.rdl.TableRuleSegment;
 import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
-import org.apache.shardingsphere.infra.binder.statement.rdl.util.ShardingAlgorithmPropertiesUtil;
-
-import java.util.Properties;
 
 /**
  * Create sharding rule statement context.
@@ -32,14 +28,4 @@ public final class CreateShardingRuleStatementContext extends CommonSQLStatement
     public CreateShardingRuleStatementContext(final CreateShardingRuleStatement sqlStatement) {
         super(sqlStatement);
     }
-    
-    /**
-     * Get algorithm properties.
-     *
-     * @param segment segment
-     * @return algorithm properties
-     */
-    public Properties getAlgorithmProperties(final TableRuleSegment segment) {
-        return ShardingAlgorithmPropertiesUtil.getProperties(segment.getAlgorithmType(), segment.getProperties());
-    }
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/rdl/util/ShardingAlgorithmPropertiesUtil.java b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/rdl/util/ShardingAlgorithmPropertiesUtil.java
deleted file mode 100644
index 878f56a..0000000
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/rdl/util/ShardingAlgorithmPropertiesUtil.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.binder.statement.rdl.util;
-
-import com.google.common.base.Preconditions;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Sharding algorithm properties util.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShardingAlgorithmPropertiesUtil {
-    
-    private static final Map<String, Collection<String>> TYPE_PROPERTIES_MAP;
-    
-    static {
-        TYPE_PROPERTIES_MAP = new LinkedHashMap<>(4, 1);
-        TYPE_PROPERTIES_MAP.put("MOD", Collections.singleton("sharding-count"));
-        TYPE_PROPERTIES_MAP.put("HASH_MOD", Collections.singleton("sharding-count"));
-        TYPE_PROPERTIES_MAP.put("VOLUME_RANGE", Arrays.asList("range-lower", "range-upper", "sharding-volume"));
-        TYPE_PROPERTIES_MAP.put("BOUNDARY_RANGE", Collections.singleton("sharding-ranges"));
-    }
-    
-    /**
-     * Get properties.
-     *
-     * @param algorithmType sharding algorithm type
-     * @param algorithmProperties sharding algorithm properties
-     * @return properties
-     */
-    public static Properties getProperties(final String algorithmType, final Collection<String> algorithmProperties) {
-        validate(algorithmType, algorithmProperties);
-        Properties result = new Properties();
-        Iterator<String> keys = TYPE_PROPERTIES_MAP.get(algorithmType).iterator();
-        Iterator<String> values = algorithmProperties.iterator();
-        while (keys.hasNext()) {
-            result.setProperty(keys.next(), values.next());
-        }
-        return result;
-    }
-    
-    private static void validate(final String algorithmType, final Collection<String> algorithmProperties) {
-        Preconditions.checkArgument(TYPE_PROPERTIES_MAP.containsKey(algorithmType), "Bad sharding algorithm type: %s.", algorithmType);
-        Preconditions.checkArgument(TYPE_PROPERTIES_MAP.get(algorithmType).size() == algorithmProperties.size(),
-                "%s needs %d properties, but %s properties are given.", algorithmType, TYPE_PROPERTIES_MAP.get(algorithmType).size(), algorithmProperties.size());
-    }
-}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/sharding/ShardingAutoTableAlgorithm.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmPropertiesAware.java
similarity index 72%
copy from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/sharding/ShardingAutoTableAlgorithm.java
copy to shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmPropertiesAware.java
index 6fa8015..1459da0 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/sharding/ShardingAutoTableAlgorithm.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmPropertiesAware.java
@@ -15,18 +15,19 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sharding.api.sharding;
+package org.apache.shardingsphere.infra.config.algorithm;
+
+import java.util.Collection;
 
 /**
- * Sharding auto table algorithm.
- *
+ * ShardingSphere algorithm  properties aware.
  */
-public interface ShardingAutoTableAlgorithm {
-
+public interface ShardingSphereAlgorithmPropertiesAware {
+    
     /**
-     * Get auto tables amount.
-     *
-     * @return the auto tables amount
+     * Get all property keys.
+     * 
+     * @return all property keys
      */
-    int getAutoTablesAmount();
+    Collection<String> getAllPropertyKeys();
 }