You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/12/18 14:16:42 UTC

[GitHub] [dubbo-go-pixiu] AlexStocks commented on a diff in pull request #530: fix:register hashing and array out of bounds and init hashing

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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org