You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2024/02/01 07:13:51 UTC

(shardingsphere) branch master updated: Remove DatabaseRuleDropExecutor.isExistRuleConfig (#29947)

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

zhangliang 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 7b7f885db80 Remove DatabaseRuleDropExecutor.isExistRuleConfig (#29947)
7b7f885db80 is described below

commit 7b7f885db805913dc1869839f2d330f84d7b7f49
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu Feb 1 15:13:45 2024 +0800

    Remove DatabaseRuleDropExecutor.isExistRuleConfig (#29947)
---
 .../distsql/handler/update/DropBroadcastTableRuleExecutor.java |  2 +-
 .../shadow/distsql/handler/update/DropShadowRuleExecutor.java  |  2 +-
 .../handler/update/DropShardingTableReferenceExecutor.java     |  2 +-
 .../type/rdl/rule/spi/database/DatabaseRuleDropExecutor.java   | 10 ----------
 4 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/update/DropBroadcastTableRuleExecutor.java b/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/update/DropBroadcastTableRuleExecutor.java
index d6f3c0d4091..a3138e24a00 100644
--- a/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/update/DropBroadcastTableRuleExecutor.java
+++ b/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/update/DropBroadcastTableRuleExecutor.java
@@ -61,7 +61,7 @@ public final class DropBroadcastTableRuleExecutor implements DatabaseRuleDropExe
     
     @Override
     public boolean hasAnyOneToBeDropped(final DropBroadcastTableRuleStatement sqlStatement) {
-        return isExistRuleConfig(rule.getConfiguration()) && !getIdenticalData(rule.getConfiguration().getTables(), sqlStatement.getTables()).isEmpty();
+        return !getIdenticalData(rule.getConfiguration().getTables(), sqlStatement.getTables()).isEmpty();
     }
     
     @Override
diff --git a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/update/DropShadowRuleExecutor.java b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/update/DropShadowRuleExecutor.java
index db390211f53..3d1920cc599 100644
--- a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/update/DropShadowRuleExecutor.java
+++ b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/update/DropShadowRuleExecutor.java
@@ -67,7 +67,7 @@ public final class DropShadowRuleExecutor implements DatabaseRuleDropExecutor<Dr
     
     @Override
     public boolean hasAnyOneToBeDropped(final DropShadowRuleStatement sqlStatement) {
-        return isExistRuleConfig(rule.getConfiguration()) && !getIdenticalData(sqlStatement.getNames(), getDataSourceNames()).isEmpty();
+        return !getIdenticalData(sqlStatement.getNames(), getDataSourceNames()).isEmpty();
     }
     
     @Override
diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/DropShardingTableReferenceExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/DropShardingTableReferenceExecutor.java
index 6468e705691..fe6fa53b611 100644
--- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/DropShardingTableReferenceExecutor.java
+++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/DropShardingTableReferenceExecutor.java
@@ -85,7 +85,7 @@ public final class DropShardingTableReferenceExecutor implements DatabaseRuleDro
     
     @Override
     public boolean hasAnyOneToBeDropped(final DropShardingTableReferenceRuleStatement sqlStatement) {
-        return isExistRuleConfig(rule.getConfiguration()) && !getIdenticalData(getCurrentShardingTableReferenceRuleNames(), sqlStatement.getNames()).isEmpty();
+        return !getIdenticalData(getCurrentShardingTableReferenceRuleNames(), sqlStatement.getNames()).isEmpty();
     }
     
     @Override
diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/rdl/rule/spi/database/DatabaseRuleDropExecutor.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/rdl/rule/spi/database/DatabaseRuleDropExecutor.java
index 0115adb7a98..edcbdb70825 100644
--- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/rdl/rule/spi/database/DatabaseRuleDropExecutor.java
+++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/type/rdl/rule/spi/database/DatabaseRuleDropExecutor.java
@@ -65,16 +65,6 @@ public interface DatabaseRuleDropExecutor<T extends SQLStatement, R extends Shar
     // TODO remove this method after remove Compatible_Cluster mode
     boolean updateCurrentRuleConfiguration(T sqlStatement, C currentRuleConfig);
     
-    /**
-     * Whether there is configuration.
-     *
-     * @param currentRuleConfig current rule configuration 
-     * @return configuration exists or does not exist
-     */
-    default boolean isExistRuleConfig(final C currentRuleConfig) {
-        return null != currentRuleConfig;
-    }
-    
     /**
      * Whether there is dropped data.
      *