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

yx9o 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 f8991a1923f Remove unused method `getRules`. (#24409)
f8991a1923f is described below

commit f8991a1923f8e23a959ac3d537c352e8cb8de64a
Author: Raigor <[email protected]>
AuthorDate: Wed Mar 1 23:16:10 2023 +0800

    Remove unused method `getRules`. (#24409)
---
 .../proxy/backend/handler/ProxyBackendHandlerFactory.java   | 13 -------------
 1 file changed, 13 deletions(-)

diff --git 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactory.java
 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactory.java
index 50c00200b27..a9ac02ce2d0 100644
--- 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactory.java
+++ 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactory.java
@@ -33,11 +33,9 @@ import 
org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.infra.executor.audit.SQLAuditEngine;
 import org.apache.shardingsphere.infra.hint.HintValueContext;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
 import 
org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions;
 import 
org.apache.shardingsphere.infra.util.exception.external.sql.type.generic.UnsupportedSQLOperationException;
 import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
-import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
 import org.apache.shardingsphere.parser.rule.SQLParserRule;
 import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
 import 
org.apache.shardingsphere.proxy.backend.handler.admin.DatabaseAdminBackendHandlerFactory;
@@ -60,9 +58,7 @@ import 
org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQ
 import org.apache.shardingsphere.transaction.utils.AutoCommitUtils;
 
 import java.sql.SQLException;
-import java.util.Collection;
 import java.util.Collections;
-import java.util.LinkedList;
 import java.util.Optional;
 
 /**
@@ -207,15 +203,6 @@ public final class ProxyBackendHandlerFactory {
         return Optional.empty();
     }
     
-    private static Collection<ShardingSphereRule> getRules(final String 
databaseName) {
-        MetaDataContexts metaDataContexts = 
ProxyContext.getInstance().getContextManager().getMetaDataContexts();
-        Collection<ShardingSphereRule> result = new 
LinkedList<>(metaDataContexts.getMetaData().getGlobalRuleMetaData().getRules());
-        if (ProxyContext.getInstance().databaseExists(databaseName)) {
-            
result.addAll(metaDataContexts.getMetaData().getDatabase(databaseName).getRuleMetaData().getRules());
-        }
-        return result;
-    }
-    
     private static void checkUnsupportedSQLStatement(final SQLStatement 
sqlStatement) {
         if (sqlStatement instanceof DCLStatement || sqlStatement instanceof 
FlushStatement || sqlStatement instanceof MySQLShowCreateUserStatement) {
             throw new UnsupportedSQLOperationException("Unsupported 
operation");

Reply via email to