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

wuweijie 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 4729839  Refactor and standardization of DropRuleStatementUpdater 
(#11036)
4729839 is described below

commit 4729839b2497c07621aa105cdd7bb59b2f858a30
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jun 27 18:05:57 2021 +0800

    Refactor and standardization of DropRuleStatementUpdater (#11036)
    
    * Refactor DropEncryptRuleStatementUpdater
    
    * Refactor DropReadwriteSplittingRuleStatementUpdater
    
    * Refactor DropShardingBindingTableRuleStatementUpdater
    
    * Refactor DropShardingBroadcastTableRuleStatementUpdater
    
    * Refactor DropShardingTableRuleStatementUpdater
    
    * Revise
    
    * Revise
---
 .../DropDatabaseDiscoveryRuleStatementUpdater.java | 13 +++--
 .../updater/DropEncryptRuleStatementUpdater.java   | 33 ++++++++-----
 ...DropReadwriteSplittingRuleStatementUpdater.java | 30 +++++++++---
 ...opShardingBindingTableRuleStatementUpdater.java |  4 ++
 ...ShardingBroadcastTableRuleStatementUpdater.java |  4 ++
 .../DropShardingTableRuleStatementUpdater.java     | 57 +++++++++++++---------
 6 files changed, 96 insertions(+), 45 deletions(-)

diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropDatabaseDiscoveryRuleStatementUpdater.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropDatabaseDiscoveryRuleStatementUpdater.java
index c821c13..28a533e 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropDatabaseDiscoveryRuleStatementUpdater.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropDatabaseDiscoveryRuleStatementUpdater.java
@@ -58,14 +58,19 @@ public final class 
DropDatabaseDiscoveryRuleStatementUpdater implements RDLUpdat
     @Override
     public boolean updateCurrentRuleConfiguration(final String schemaName, 
final DropDatabaseDiscoveryRuleStatement sqlStatement, final 
DatabaseDiscoveryRuleConfiguration currentRuleConfig) {
         for (String each : sqlStatement.getRuleNames()) {
-            Optional<DatabaseDiscoveryDataSourceRuleConfiguration> 
dataSourceRuleConfig = 
currentRuleConfig.getDataSources().stream().filter(dataSource -> 
dataSource.getName().equals(each)).findAny();
-            Preconditions.checkState(dataSourceRuleConfig.isPresent());
-            
currentRuleConfig.getDataSources().remove(dataSourceRuleConfig.get());
-            
currentRuleConfig.getDiscoveryTypes().remove(dataSourceRuleConfig.get().getDiscoveryTypeName());
+            dropRule(currentRuleConfig, each);
         }
         return currentRuleConfig.getDataSources().isEmpty();
     }
     
+    private void dropRule(final DatabaseDiscoveryRuleConfiguration 
currentRuleConfig, final String ruleName) {
+        Optional<DatabaseDiscoveryDataSourceRuleConfiguration> 
dataSourceRuleConfig = 
currentRuleConfig.getDataSources().stream().filter(dataSource -> 
dataSource.getName().equals(ruleName)).findAny();
+        Preconditions.checkState(dataSourceRuleConfig.isPresent());
+        currentRuleConfig.getDataSources().remove(dataSourceRuleConfig.get());
+        // TODO Do we need to check DiscoveryType not in use before drop it? 
+        
currentRuleConfig.getDiscoveryTypes().remove(dataSourceRuleConfig.get().getDiscoveryTypeName());
+    }
+    
     @Override
     public String getType() {
         return DropDatabaseDiscoveryRuleStatement.class.getCanonicalName();
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropEncryptRuleStatementUpdater.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropEncryptRuleStatementUpdater.java
index 1a95c70..b914e73 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropEncryptRuleStatementUpdater.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropEncryptRuleStatementUpdater.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.proxy.backend.text.distsql.rdl.impl.updater;
 
+import com.google.common.base.Preconditions;
 import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
 import 
org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
 import 
org.apache.shardingsphere.encrypt.distsql.parser.statement.DropEncryptRuleStatement;
@@ -25,6 +26,7 @@ import 
org.apache.shardingsphere.infra.metadata.resource.ShardingSphereResource;
 import 
org.apache.shardingsphere.proxy.backend.exception.EncryptRuleNotExistedException;
 
 import java.util.Collection;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 /**
@@ -34,30 +36,39 @@ public final class DropEncryptRuleStatementUpdater 
implements RDLUpdater<DropEnc
     
     @Override
     public void checkSQLStatement(final String schemaName, final 
DropEncryptRuleStatement sqlStatement, final EncryptRuleConfiguration 
currentRuleConfig, final ShardingSphereResource resource) {
+        checkCurrentRuleConfiguration(schemaName, sqlStatement, 
currentRuleConfig);
+        checkToBeDroppedEncryptTableNames(schemaName, sqlStatement, 
currentRuleConfig);
+    }
+    
+    private void checkCurrentRuleConfiguration(final String schemaName, final 
DropEncryptRuleStatement sqlStatement, final EncryptRuleConfiguration 
currentRuleConfig) {
         if (null == currentRuleConfig) {
             throw new EncryptRuleNotExistedException(schemaName, 
sqlStatement.getTables());
         }
-        check(schemaName, sqlStatement.getTables(), currentRuleConfig);
     }
     
-    private void check(final String schemaName, final Collection<String> 
droppedTables, final EncryptRuleConfiguration currentRuleConfig) {
-        Collection<String> encryptTables = 
currentRuleConfig.getTables().stream().map(EncryptTableRuleConfiguration::getName).collect(Collectors.toList());
-        Collection<String> notExistedTables = 
droppedTables.stream().filter(each -> 
!encryptTables.contains(each)).collect(Collectors.toList());
-        if (!notExistedTables.isEmpty()) {
-            throw new EncryptRuleNotExistedException(schemaName, 
notExistedTables);
+    private void checkToBeDroppedEncryptTableNames(final String schemaName, 
final DropEncryptRuleStatement sqlStatement, final EncryptRuleConfiguration 
currentRuleConfig) {
+        Collection<String> currentEncryptTableNames = 
currentRuleConfig.getTables().stream().map(EncryptTableRuleConfiguration::getName).collect(Collectors.toList());
+        Collection<String> notExistedTableNames = 
sqlStatement.getTables().stream().filter(each -> 
!currentEncryptTableNames.contains(each)).collect(Collectors.toList());
+        if (!notExistedTableNames.isEmpty()) {
+            throw new EncryptRuleNotExistedException(schemaName, 
notExistedTableNames);
         }
     }
     
     @Override
     public boolean updateCurrentRuleConfiguration(final String schemaName, 
final DropEncryptRuleStatement sqlStatement, final EncryptRuleConfiguration 
currentRuleConfig) {
-        sqlStatement.getTables().forEach(each -> {
-            EncryptTableRuleConfiguration encryptTableRuleConfiguration = 
currentRuleConfig.getTables().stream().filter(tableRule -> 
tableRule.getName().equals(each)).findAny().get();
-            
currentRuleConfig.getTables().remove(encryptTableRuleConfiguration);
-            encryptTableRuleConfiguration.getColumns().forEach(column -> 
currentRuleConfig.getEncryptors().remove(column.getEncryptorName()));
-        });
+        for (String each : sqlStatement.getTables()) {
+            dropRule(currentRuleConfig, each);
+        }
         return currentRuleConfig.getTables().isEmpty();
     }
     
+    private void dropRule(final EncryptRuleConfiguration currentRuleConfig, 
final String ruleName) {
+        Optional<EncryptTableRuleConfiguration> encryptTableRuleConfig = 
currentRuleConfig.getTables().stream().filter(tableRule -> 
tableRule.getName().equals(ruleName)).findAny();
+        Preconditions.checkState(encryptTableRuleConfig.isPresent());
+        currentRuleConfig.getTables().remove(encryptTableRuleConfig.get());
+        encryptTableRuleConfig.get().getColumns().forEach(column -> 
currentRuleConfig.getEncryptors().remove(column.getEncryptorName()));
+    }
+    
     @Override
     public String getType() {
         return DropEncryptRuleStatement.class.getCanonicalName();
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropReadwriteSplittingRuleStatementUpdater.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropReadwriteSplittingRuleStatementUpdater.java
index 661ed03..0395cb4 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropReadwriteSplittingRuleStatementUpdater.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropReadwriteSplittingRuleStatementUpdater.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.proxy.backend.text.distsql.rdl.impl.updater;
 
+import com.google.common.base.Preconditions;
 import org.apache.shardingsphere.infra.distsql.RDLUpdater;
 import 
org.apache.shardingsphere.infra.metadata.resource.ShardingSphereResource;
 import 
org.apache.shardingsphere.proxy.backend.exception.ReadwriteSplittingRuleNotExistedException;
@@ -25,6 +26,7 @@ import 
org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingD
 import 
org.apache.shardingsphere.readwritesplitting.distsql.parser.statement.DropReadwriteSplittingRuleStatement;
 
 import java.util.Collection;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 /**
@@ -35,11 +37,19 @@ public final class 
DropReadwriteSplittingRuleStatementUpdater implements RDLUpda
     @Override
     public void checkSQLStatement(final String schemaName, final 
DropReadwriteSplittingRuleStatement sqlStatement, 
                                   final ReadwriteSplittingRuleConfiguration 
currentRuleConfig, final ShardingSphereResource resource) {
+        checkCurrentRuleConfiguration(schemaName, sqlStatement, 
currentRuleConfig);
+        checkToBeDroppedRuleNames(schemaName, sqlStatement, currentRuleConfig);
+    }
+    
+    private void checkCurrentRuleConfiguration(final String schemaName, final 
DropReadwriteSplittingRuleStatement sqlStatement, final 
ReadwriteSplittingRuleConfiguration currentRuleConfig) {
         if (null == currentRuleConfig) {
             throw new ReadwriteSplittingRuleNotExistedException(schemaName, 
sqlStatement.getRuleNames());
         }
-        Collection<String> existRuleNames = 
currentRuleConfig.getDataSources().stream().map(ReadwriteSplittingDataSourceRuleConfiguration::getName).collect(Collectors.toList());
-        Collection<String> notExistedRuleNames = 
sqlStatement.getRuleNames().stream().filter(each -> 
!existRuleNames.contains(each)).collect(Collectors.toList());
+    }
+    
+    private void checkToBeDroppedRuleNames(final String schemaName, final 
DropReadwriteSplittingRuleStatement sqlStatement, final 
ReadwriteSplittingRuleConfiguration currentRuleConfig) {
+        Collection<String> currentRuleNames = 
currentRuleConfig.getDataSources().stream().map(ReadwriteSplittingDataSourceRuleConfiguration::getName).collect(Collectors.toList());
+        Collection<String> notExistedRuleNames = 
sqlStatement.getRuleNames().stream().filter(each -> 
!currentRuleNames.contains(each)).collect(Collectors.toList());
         if (!notExistedRuleNames.isEmpty()) {
             throw new ReadwriteSplittingRuleNotExistedException(schemaName, 
sqlStatement.getRuleNames());
         }
@@ -47,14 +57,20 @@ public final class 
DropReadwriteSplittingRuleStatementUpdater implements RDLUpda
     
     @Override
     public boolean updateCurrentRuleConfiguration(final String schemaName, 
final DropReadwriteSplittingRuleStatement sqlStatement, final 
ReadwriteSplittingRuleConfiguration currentRuleConfig) {
-        sqlStatement.getRuleNames().forEach(each -> {
-            ReadwriteSplittingDataSourceRuleConfiguration dataSourceRuleConfig 
= currentRuleConfig.getDataSources().stream().filter(dataSource -> 
each.equals(dataSource.getName())).findAny().get();
-            currentRuleConfig.getDataSources().remove(dataSourceRuleConfig);
-            
currentRuleConfig.getLoadBalancers().remove(dataSourceRuleConfig.getLoadBalancerName());
-        });
+        for (String each : sqlStatement.getRuleNames()) {
+            dropRule(currentRuleConfig, each);
+        }
         return currentRuleConfig.getDataSources().isEmpty();
     }
     
+    private void dropRule(final ReadwriteSplittingRuleConfiguration 
currentRuleConfig, final String ruleName) {
+        Optional<ReadwriteSplittingDataSourceRuleConfiguration> 
dataSourceRuleConfig
+                = 
currentRuleConfig.getDataSources().stream().filter(dataSource -> 
ruleName.equals(dataSource.getName())).findAny();
+        Preconditions.checkState(dataSourceRuleConfig.isPresent());
+        currentRuleConfig.getDataSources().remove(dataSourceRuleConfig.get());
+        
currentRuleConfig.getLoadBalancers().remove(dataSourceRuleConfig.get().getLoadBalancerName());
+    }
+    
     @Override
     public String getType() {
         return DropReadwriteSplittingRuleStatement.class.getCanonicalName();
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingBindingTableRuleStatementUpdater.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingBindingTableRuleStatementUpdater.java
index 92bc564..f4f319c 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingBindingTableRuleStatementUpdater.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingBindingTableRuleStatementUpdater.java
@@ -31,6 +31,10 @@ public final class 
DropShardingBindingTableRuleStatementUpdater implements RDLUp
     @Override
     public void checkSQLStatement(final String schemaName, final 
DropShardingBindingTableRulesStatement sqlStatement, 
                                   final ShardingRuleConfiguration 
currentRuleConfig, final ShardingSphereResource resource) {
+        checkCurrentRuleConfiguration(schemaName, currentRuleConfig);
+    }
+    
+    private void checkCurrentRuleConfiguration(final String schemaName, final 
ShardingRuleConfiguration currentRuleConfig) {
         if (null == currentRuleConfig || 
currentRuleConfig.getBindingTableGroups().isEmpty()) {
             throw new ShardingBindingTableRuleNotExistsException(schemaName);
         }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingBroadcastTableRuleStatementUpdater.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingBroadcastTableRuleStatementUpdater.java
index 87c1660..6a5a280 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingBroadcastTableRuleStatementUpdater.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingBroadcastTableRuleStatementUpdater.java
@@ -31,6 +31,10 @@ public final class 
DropShardingBroadcastTableRuleStatementUpdater implements RDL
     @Override
     public void checkSQLStatement(final String schemaName, final 
DropShardingBroadcastTableRulesStatement sqlStatement, 
                                   final ShardingRuleConfiguration 
currentRuleConfig, final ShardingSphereResource resource) {
+        checkCurrentRuleConfiguration(schemaName, currentRuleConfig);
+    }
+    
+    private void checkCurrentRuleConfiguration(final String schemaName, final 
ShardingRuleConfiguration currentRuleConfig) {
         if (null == currentRuleConfig || 
currentRuleConfig.getBroadcastTables().isEmpty()) {
             throw new ShardingBroadcastTableRuleNotExistsException(schemaName);
         }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingTableRuleStatementUpdater.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingTableRuleStatementUpdater.java
index fcc7147..86c13f1 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingTableRuleStatementUpdater.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/updater/DropShardingTableRuleStatementUpdater.java
@@ -40,52 +40,63 @@ public final class DropShardingTableRuleStatementUpdater 
implements RDLUpdater<D
     @Override
     public void checkSQLStatement(final String schemaName, final 
DropShardingTableRuleStatement sqlStatement, 
                                   final ShardingRuleConfiguration 
currentRuleConfig, final ShardingSphereResource resource) {
-        Collection<String> tableNames = 
sqlStatement.getTableNames().stream().map(each -> 
each.getIdentifier().getValue()).collect(Collectors.toList());
+        checkCurrentRuleConfiguration(schemaName, sqlStatement, 
currentRuleConfig);
+        checkToBeDroppedShardingTableNames(schemaName, sqlStatement, 
currentRuleConfig);
+        checkBindingTables(sqlStatement, currentRuleConfig);
+    }
+    
+    private void checkCurrentRuleConfiguration(final String schemaName, final 
DropShardingTableRuleStatement sqlStatement, final ShardingRuleConfiguration 
currentRuleConfig) {
         if (null == currentRuleConfig) {
-            throw new ShardingTableRuleNotExistedException(schemaName, 
tableNames);
+            throw new ShardingTableRuleNotExistedException(schemaName, 
getToBeDroppedShardingTableNames(sqlStatement));
         }
-        Collection<String> shardingTableNames = 
getShardingTables(currentRuleConfig);
-        Collection<String> notExistedTableNames = 
tableNames.stream().filter(each -> 
!shardingTableNames.contains(each)).collect(Collectors.toList());
+    }
+    
+    private Collection<String> getToBeDroppedShardingTableNames(final 
DropShardingTableRuleStatement sqlStatement) {
+        return sqlStatement.getTableNames().stream().map(each -> 
each.getIdentifier().getValue()).collect(Collectors.toList());
+    }
+    
+    private void checkToBeDroppedShardingTableNames(final String schemaName, 
final DropShardingTableRuleStatement sqlStatement, final 
ShardingRuleConfiguration currentRuleConfig) {
+        Collection<String> currentShardingTableNames = 
getCurrentShardingTableNames(currentRuleConfig);
+        Collection<String> notExistedTableNames = 
getToBeDroppedShardingTableNames(sqlStatement).stream().filter(each -> 
!currentShardingTableNames.contains(each)).collect(Collectors.toList());
         if (!notExistedTableNames.isEmpty()) {
             throw new ShardingTableRuleNotExistedException(schemaName, 
notExistedTableNames);
         }
+    }
+    
+    private Collection<String> getCurrentShardingTableNames(final 
ShardingRuleConfiguration shardingRuleConfig) {
+        Collection<String> result = new LinkedList<>();
+        
result.addAll(shardingRuleConfig.getTables().stream().map(ShardingTableRuleConfiguration::getLogicTable).collect(Collectors.toList()));
+        
result.addAll(shardingRuleConfig.getAutoTables().stream().map(ShardingAutoTableRuleConfiguration::getLogicTable).collect(Collectors.toList()));
+        return result;
+    }
+    
+    private void checkBindingTables(final DropShardingTableRuleStatement 
sqlStatement, final ShardingRuleConfiguration currentRuleConfig) {
         Collection<String> bindingTables = getBindingTables(currentRuleConfig);
-        Collection<String> usedTableNames = 
tableNames.stream().filter(bindingTables::contains).collect(Collectors.toList());
+        Collection<String> usedTableNames = 
getToBeDroppedShardingTableNames(sqlStatement).stream().filter(bindingTables::contains).collect(Collectors.toList());
         if (!usedTableNames.isEmpty()) {
             throw new ShardingTableRulesInUsedException(usedTableNames);
         }
     }
     
+    private Collection<String> getBindingTables(final 
ShardingRuleConfiguration shardingRuleConfig) {
+        Collection<String> result = new LinkedHashSet<>();
+        shardingRuleConfig.getBindingTableGroups().forEach(each -> 
result.addAll(Splitter.on(",").splitToList(each)));
+        return result;
+    }
+    
     @Override
     public boolean updateCurrentRuleConfiguration(final String schemaName, 
final DropShardingTableRuleStatement sqlStatement, final 
ShardingRuleConfiguration currentRuleConfig) {
-        for (String each : getDroppedTables(sqlStatement)) {
+        for (String each : getToBeDroppedShardingTableNames(sqlStatement)) {
             dropShardingTable(currentRuleConfig, each);
         }
         return false;
     }
     
-    private Collection<String> getDroppedTables(final 
DropShardingTableRuleStatement sqlStatement) {
-        return sqlStatement.getTableNames().stream().map(each -> 
each.getIdentifier().getValue()).collect(Collectors.toList());
-    }
-    
-    private Collection<String> getShardingTables(final 
ShardingRuleConfiguration shardingRuleConfig) {
-        Collection<String> result = new LinkedList<>();
-        
result.addAll(shardingRuleConfig.getTables().stream().map(ShardingTableRuleConfiguration::getLogicTable).collect(Collectors.toList()));
-        
result.addAll(shardingRuleConfig.getAutoTables().stream().map(ShardingAutoTableRuleConfiguration::getLogicTable).collect(Collectors.toList()));
-        return result;
-    }
-    
     private void dropShardingTable(final ShardingRuleConfiguration 
currentRuleConfig, final String tableName) {
         
currentRuleConfig.getTables().removeAll(currentRuleConfig.getTables().stream().filter(each
 -> 
tableName.equalsIgnoreCase(each.getLogicTable())).collect(Collectors.toList()));
         
currentRuleConfig.getAutoTables().removeAll(currentRuleConfig.getAutoTables().stream().filter(each
 -> 
tableName.equalsIgnoreCase(each.getLogicTable())).collect(Collectors.toList()));
     }
     
-    private Collection<String> getBindingTables(final 
ShardingRuleConfiguration shardingRuleConfig) {
-        Collection<String> result = new LinkedHashSet<>();
-        shardingRuleConfig.getBindingTableGroups().forEach(each -> 
result.addAll(Splitter.on(",").splitToList(each)));
-        return result;
-    }
-    
     @Override
     public String getType() {
         return DropShardingTableRuleStatement.class.getCanonicalName();

Reply via email to