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 1b344c4  Private StoragePrivilegeBuilder's unnecessary method (#10003)
1b344c4 is described below

commit 1b344c416ec74d69628c2ceb646963a309858b3f
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Apr 9 14:28:35 2021 +0800

    Private StoragePrivilegeBuilder's unnecessary method (#10003)
---
 .../loader/storage/impl/StoragePrivilegeBuilder.java | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git 
a/shardingsphere-features/shardingsphere-authority/shardingsphere-authority-common/src/main/java/org/apache/shardingsphere/authority/loader/storage/impl/StoragePrivilegeBuilder.java
 
b/shardingsphere-features/shardingsphere-authority/shardingsphere-authority-common/src/main/java/org/apache/shardingsphere/authority/loader/storage/impl/StoragePrivilegeBuilder.java
index 5c1bfee..a19c60a 100644
--- 
a/shardingsphere-features/shardingsphere-authority/shardingsphere-authority-common/src/main/java/org/apache/shardingsphere/authority/loader/storage/impl/StoragePrivilegeBuilder.java
+++ 
b/shardingsphere-features/shardingsphere-authority/shardingsphere-authority-common/src/main/java/org/apache/shardingsphere/authority/loader/storage/impl/StoragePrivilegeBuilder.java
@@ -24,7 +24,6 @@ import 
org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.infra.exception.ShardingSphereException;
 import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
-import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
 import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
 import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
 
@@ -86,24 +85,9 @@ public final class StoragePrivilegeBuilder {
     }
     
     private static Map<ShardingSphereUser, ShardingSpherePrivileges> 
build(final ShardingSphereMetaData metaData, final 
Collection<ShardingSphereUser> users, final StoragePrivilegeLoader loader) {
-        return build(metaData.getName(), 
metaData.getResource().getAllInstanceDataSources(), 
metaData.getRuleMetaData().getRules(), users, loader);
-    }
-    
-    /**
-     * Build privileges.
-     * 
-     * @param schemaName schema name
-     * @param dataSources data sources
-     * @param rules rules
-     * @param users users
-     * @param loader privilege loader
-     * @return privileges
-     */
-    public static Map<ShardingSphereUser, ShardingSpherePrivileges> 
build(final String schemaName, final Collection<DataSource> dataSources,
-                                                                          
final Collection<ShardingSphereRule> rules, final 
Collection<ShardingSphereUser> users, final StoragePrivilegeLoader loader) {
-        Map<ShardingSphereUser, Collection<ShardingSpherePrivileges>> result = 
load(dataSources, users, loader);
+        Map<ShardingSphereUser, Collection<ShardingSpherePrivileges>> result = 
load(metaData.getResource().getAllInstanceDataSources(), users, loader);
         checkPrivileges(result);
-        return StoragePrivilegeMerger.merge(result, schemaName, rules);
+        return StoragePrivilegeMerger.merge(result, metaData.getName(), 
metaData.getRuleMetaData().getRules());
     }
     
     private static Map<ShardingSphereUser, 
Collection<ShardingSpherePrivileges>> load(final Collection<DataSource> 
dataSources,

Reply via email to