Pace2Car commented on code in PR #24934:
URL: https://github.com/apache/shardingsphere/pull/24934#discussion_r1172221790


##########
features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/algorithm/loadbalance/WeightReadQueryLoadBalanceAlgorithm.java:
##########
@@ -50,6 +51,17 @@ public final class WeightReadQueryLoadBalanceAlgorithm 
implements ReadQueryLoadB
     public void init(final Properties props) {
         this.props = props;
         dataSourceNames = props.stringPropertyNames();
+        ShardingSpherePreconditions.checkState(!dataSourceNames.isEmpty(), () 
-> new ReadQueryLoadBalanceAlgorithmInitializationExcpetion(getType(), "Read 
data source is required"));
+        for (String dataSourceName : dataSourceNames) {
+            Object weightObject = props.get(dataSourceName);

Review Comment:
   Here you can directly get the String from props.getProperty().



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