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 2021/11/17 01:30:50 UTC
[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #13640: default single table rule routing and configuration support
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org