You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/03/26 08:22:20 UTC

[GitHub] [incubator-shardingsphere] yu199195 opened a new pull request #4955: lambda code modify.

yu199195 opened a new pull request #4955:  lambda code modify.
URL: https://github.com/apache/incubator-shardingsphere/pull/4955
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] kimmking commented on a change in pull request #4955: lambda code modify.

Posted by GitBox <gi...@apache.org>.
kimmking commented on a change in pull request #4955:  lambda code modify.
URL: https://github.com/apache/incubator-shardingsphere/pull/4955#discussion_r398398738
 
 

 ##########
 File path: sharding-proxy/sharding-proxy-common/src/main/java/org/apache/shardingsphere/shardingproxy/config/ShardingConfigurationLoader.java
 ##########
 @@ -64,10 +64,7 @@ public ShardingConfiguration load(final String path) throws IOException {
             });
         }
         Preconditions.checkState(!ruleConfigurations.isEmpty() || null != serverConfig.getOrchestration(), "Can not find any sharding rule configuration file in path `%s`.", configPath.getPath());
-        Map<String, YamlProxyRuleConfiguration> ruleConfigurationMap = new HashMap<>(ruleConfigurations.size(), 1);
-        for (YamlProxyRuleConfiguration each : ruleConfigurations) {
-            ruleConfigurationMap.put(each.getSchemaName(), each);
-        }
+        Map<String, YamlProxyRuleConfiguration> ruleConfigurationMap = ruleConfigurations.stream().collect(Collectors.toMap(YamlProxyRuleConfiguration::getSchemaName, each -> each));
         return new ShardingConfiguration(serverConfig, ruleConfigurationMap);
 
 Review comment:
   can combine one line
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] yu199195 closed pull request #4955: lambda code modify.

Posted by GitBox <gi...@apache.org>.
yu199195 closed pull request #4955:  lambda code modify.
URL: https://github.com/apache/incubator-shardingsphere/pull/4955
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu commented on a change in pull request #4955: lambda code modify.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #4955:  lambda code modify.
URL: https://github.com/apache/incubator-shardingsphere/pull/4955#discussion_r398395061
 
 

 ##########
 File path: shardingsphere-underlying/shardingsphere-common/src/main/java/org/apache/shardingsphere/underlying/common/database/type/DatabaseTypes.java
 ##########
 @@ -60,40 +61,29 @@ public static DatabaseType getTrunkDatabaseType(final String name) {
     
     /**
      * Get actual database type.
+     * @param name database name
      *
-     * @param name database name 
      * @return actual database type
      */
     public static DatabaseType getActualDatabaseType(final String name) {
-        Preconditions.checkState(DATABASE_TYPES.containsKey(name), "Unsupported database: '%s'", name);
-        return DATABASE_TYPES.get(name);
+        return Optional.ofNullable(DATABASE_TYPES.get(name)).orElseThrow(() -> new ShardingSphereException("Unsupported database:'%s'", name));
     }
     
     /**
      * Get database type by URL.
-     * 
      * @param url database URL
+     *
 
 Review comment:
   Please do not modify original javadoc

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu commented on a change in pull request #4955: lambda code modify.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #4955:  lambda code modify.
URL: https://github.com/apache/incubator-shardingsphere/pull/4955#discussion_r398394707
 
 

 ##########
 File path: shardingsphere-underlying/shardingsphere-common/src/main/java/org/apache/shardingsphere/underlying/common/database/type/DatabaseTypes.java
 ##########
 @@ -40,8 +41,8 @@
     
     /**
      * Get name of trunk database type.
-     * 
      * @param databaseType database type
+     *
 
 Review comment:
   Please do not modify original javadoc

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu commented on a change in pull request #4955: lambda code modify.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #4955:  lambda code modify.
URL: https://github.com/apache/incubator-shardingsphere/pull/4955#discussion_r398394818
 
 

 ##########
 File path: shardingsphere-underlying/shardingsphere-common/src/main/java/org/apache/shardingsphere/underlying/common/database/type/DatabaseTypes.java
 ##########
 @@ -50,8 +51,8 @@ public static String getTrunkDatabaseTypeName(final DatabaseType databaseType) {
     
     /**
      * Get trunk database type.
+     * @param name database name
 
 Review comment:
   Please do not modify original javadoc

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu commented on a change in pull request #4955: lambda code modify.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #4955:  lambda code modify.
URL: https://github.com/apache/incubator-shardingsphere/pull/4955#discussion_r398394882
 
 

 ##########
 File path: shardingsphere-underlying/shardingsphere-common/src/main/java/org/apache/shardingsphere/underlying/common/database/type/DatabaseTypes.java
 ##########
 @@ -60,40 +61,29 @@ public static DatabaseType getTrunkDatabaseType(final String name) {
     
     /**
      * Get actual database type.
+     * @param name database name
 
 Review comment:
   Please do not modify original javadoc

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services