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/09/29 09:42:02 UTC

[GitHub] [shardingsphere] menghaoranss commented on a change in pull request #7660: Try to extract sharding columns from target config if it's available.

menghaoranss commented on a change in pull request #7660:
URL: https://github.com/apache/shardingsphere/pull/7660#discussion_r496582362



##########
File path: shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/ShardingSphereJDBCConfiguration.java
##########
@@ -40,7 +40,15 @@
     public ShardingSphereJDBCConfiguration(final String dataSource, final String rule) {
         this.dataSource = dataSource;
         this.rule = rule;
-        Map<String, org.apache.shardingsphere.infra.config.datasource.DataSourceConfiguration> sourceDataSource = ConfigurationYamlConverter.loadDataSourceConfigurations(dataSource);
-        this.databaseType = DatabaseTypes.getDatabaseTypeByURL(sourceDataSource.values().iterator().next().getProps().get("jdbcUrl").toString());
+        this.databaseType = getDatabaseType();
+    }
+    
+    @Override
+    public DatabaseType getDatabaseType() {
+        if (databaseType == null) {

Review comment:
       null == databaseType




----------------------------------------------------------------
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