AlexStocks commented on code in PR #530:
URL: https://github.com/apache/dubbo-go-pixiu/pull/530#discussion_r1051611024
##########
pixiu/pkg/server/cluster_manager.go:
##########
@@ -149,19 +149,19 @@ func (cm *ClusterManager) CompareAndSetStore(store
*ClusterStore) bool {
return true
}
-func (cm *ClusterManager) PickEndpoint(clusterName string) *model.Endpoint {
+func (cm *ClusterManager) PickEndpoint(clusterName string, policy
model.HashPolicy) *model.Endpoint {
cm.rw.RLock()
defer cm.rw.RUnlock()
for _, c := range cm.store.Config {
if c.Name == clusterName {
- return cm.pickOneEndpoint(c)
+ return cm.pickOneEndpoint(c, policy)
}
}
return nil
}
-func (cm *ClusterManager) pickOneEndpoint(c *model.ClusterConfig)
*model.Endpoint {
+func (cm *ClusterManager) pickOneEndpoint(c *model.ClusterConfig, policy
model.HashPolicy) *model.Endpoint {
Review Comment:
这里有必要单独加个 HashPolicy 的参数吗?如果将来我们添加一个别的非 Hash 策略,然后这里就再添加一个参数吗?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]