zjcnb commented on a change in pull request #14856: URL: https://github.com/apache/shardingsphere/pull/14856#discussion_r786463040
########## File path: shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/algorithm/loadbalance/WeightReplicaLoadBalanceAlgorithm.java ########## @@ -53,6 +53,9 @@ public String getDataSource(final String name, final String writeDataSourceName, } private String getDataSourceName(final List<String> readDataSourceNames, final double[] weight) { + if (1 == readDataSourceNames.size()) { + return readDataSourceNames.stream().findFirst().get(); Review comment: I will adjust `get(0)`. -- 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-unsubscr...@shardingsphere.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org