strongduanmu commented on a change in pull request #13640:
URL: https://github.com/apache/shardingsphere/pull/13640#discussion_r750812735



##########
File path: 
shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/rule/SingleTableRule.java
##########
@@ -113,6 +117,14 @@ public boolean isAllTablesInSameDataSource(final 
RouteContext routeContext, fina
         return true;
     }
     
+    /**
+     * Get default data source.

Review comment:
       @lanchengx A blank line is required after javadoc.

##########
File path: 
shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilder.java
##########
@@ -33,7 +33,9 @@
     
     @Override
     public SingleTableRule build(final SchemaRulesBuilderMaterials materials, 
final SingleTableRuleConfiguration config, final Collection<ShardingSphereRule> 
builtRules) {
-        return new SingleTableRule(materials.getDatabaseType(), 
materials.getDataSourceMap(), builtRules, materials.getProps());
+        SingleTableRule singleTableRule = new 
SingleTableRule(materials.getDatabaseType(), materials.getDataSourceMap(), 
builtRules, materials.getProps());
+        
config.getDefaultDataSource().ifPresent(singleTableRule::setDefaultDataSource);

Review comment:
       @lanchengx Can we use the constructor to replace the 
setDefaultDataSource method?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to