TeslaCN commented on a change in pull request #14947:
URL: https://github.com/apache/shardingsphere/pull/14947#discussion_r788657392
##########
File path:
shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/ReadwriteSplittingDataSourceRule.java
##########
@@ -102,6 +106,17 @@ public void updateDisabledDataSourceNames(final String
dataSourceName, final boo
* @return data sources
*/
public Map<String, String> getDataSources() {
- return readwriteSplittingType.getDataSources();
+ return readwriteSplittingType.getDataSources().entrySet().stream()
+ .collect(Collectors.toMap(Entry::getKey,
+ each ->
each.getKey().equals(ExportableConstants.REPLICA_DATA_SOURCE_NAMES) ?
removeDisabledDataSources(each.getValue()) : each.getValue()));
Review comment:
Consider flipping the `equals`.
--
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]