FlyingZC commented on code in PR #20770:
URL: https://github.com/apache/shardingsphere/pull/20770#discussion_r970255126
##########
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngine.java:
##########
@@ -64,9 +66,7 @@ public static DatabaseType getProtocolType(final Map<String,
? extends DatabaseC
if (configuredDatabaseType.isPresent()) {
return configuredDatabaseType.get();
}
- Collection<DataSource> dataSources = databaseConfigs.values().stream()
- .filter(each ->
!each.getDataSources().isEmpty()).findFirst().map(optional ->
optional.getDataSources().values()).orElseGet(Collections::emptyList);
- return getDatabaseType(dataSources);
+ return
getDatabaseType(DataSourceStateManager.getInstance().getEnabledDataSources(databaseConfigs));
Review Comment:
You are right.I shouldn't manage logic other than data source state.I will
change the api.
--
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]