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 2022/11/11 10:47:06 UTC

[GitHub] [shardingsphere] zhaojinchao95 opened a new pull request, #22085: Refactor ReadwriteSplittingRule and TrafficRule trafficAlgorithm map and loadBalancers map

zhaojinchao95 opened a new pull request, #22085:
URL: https://github.com/apache/shardingsphere/pull/22085

   Fixes #22050, #https://github.com/apache/shardingsphere/pull/22059.
   


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


[GitHub] [shardingsphere] zhaojinchao95 commented on a diff in pull request #22085: Refactor ReadwriteSplittingRule and TrafficRule trafficAlgorithm map and loadBalancers map

Posted by GitBox <gi...@apache.org>.
zhaojinchao95 commented on code in PR #22085:
URL: https://github.com/apache/shardingsphere/pull/22085#discussion_r1020141199


##########
kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/rule/TrafficRule.java:
##########
@@ -132,8 +137,8 @@ public Optional<TrafficStrategyRule> findMatchedStrategyRule(final QueryContext
         return Optional.empty();
     }
     
-    private TrafficAlgorithm getTrafficAlgorithm(final Map<String, TrafficAlgorithm> trafficAlgorithms, final String algorithmName) {
-        TrafficAlgorithm result = trafficAlgorithms.get(algorithmName);
+    private TrafficAlgorithm getTrafficAlgorithm(final TrafficStrategyConfiguration strategyConfig, final Map<String, TrafficAlgorithm> trafficAlgorithms) {
+        TrafficAlgorithm result = trafficAlgorithms.get(strategyConfig.getName() + "_" + strategyConfig.getAlgorithmName());

Review Comment:
   Yes, i think so



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


[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #22085: Refactor ReadwriteSplittingRule and TrafficRule trafficAlgorithm map and loadBalancers map

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #22085:
URL: https://github.com/apache/shardingsphere/pull/22085#discussion_r1020136256


##########
kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/rule/TrafficRule.java:
##########
@@ -132,8 +137,8 @@ public Optional<TrafficStrategyRule> findMatchedStrategyRule(final QueryContext
         return Optional.empty();
     }
     
-    private TrafficAlgorithm getTrafficAlgorithm(final Map<String, TrafficAlgorithm> trafficAlgorithms, final String algorithmName) {
-        TrafficAlgorithm result = trafficAlgorithms.get(algorithmName);
+    private TrafficAlgorithm getTrafficAlgorithm(final TrafficStrategyConfiguration strategyConfig, final Map<String, TrafficAlgorithm> trafficAlgorithms) {
+        TrafficAlgorithm result = trafficAlgorithms.get(strategyConfig.getName() + "_" + strategyConfig.getAlgorithmName());

Review Comment:
   Do you think use `.` is better?



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


[GitHub] [shardingsphere] strongduanmu merged pull request #22085: Refactor ReadwriteSplittingRule and TrafficRule trafficAlgorithm map and loadBalancers map

Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #22085:
URL: https://github.com/apache/shardingsphere/pull/22085


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