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 2020/07/29 07:49:37 UTC

[GitHub] [dubbo-go] zouyx commented on a change in pull request #659: Ftr: Nearest first for multiple registry

zouyx commented on a change in pull request #659:
URL: https://github.com/apache/dubbo-go/pull/659#discussion_r461304239



##########
File path: cluster/cluster_impl/zone_aware_cluster.go
##########
@@ -23,18 +23,23 @@ import (
 	"github.com/apache/dubbo-go/protocol"
 )
 
-type registryAwareCluster struct{}
+type zoneAwareCluster struct{}
+
+const zoneAware = "zoneAware"
 
 func init() {
-	extension.SetCluster("registryAware", NewRegistryAwareCluster)
+	extension.SetCluster(zoneAware, NewZoneAwareCluster)
+}
+
+// NewZoneAwareCluster ...
+func NewZoneAwareCluster() cluster.Cluster {
+	return &zoneAwareCluster{}
 }
 
-// NewRegistryAwareCluster returns a registry aware cluster instance
-func NewRegistryAwareCluster() cluster.Cluster {
-	return &registryAwareCluster{}
+func (cluster *zoneAwareCluster) Join(directory cluster.Directory) protocol.Invoker {

Review comment:
       add comment for all public methods

##########
File path: cluster/cluster_impl/zone_aware_cluster.go
##########
@@ -23,18 +23,23 @@ import (
 	"github.com/apache/dubbo-go/protocol"
 )
 
-type registryAwareCluster struct{}
+type zoneAwareCluster struct{}
+
+const zoneAware = "zoneAware"
 
 func init() {
-	extension.SetCluster("registryAware", NewRegistryAwareCluster)
+	extension.SetCluster(zoneAware, NewZoneAwareCluster)
+}
+
+// NewZoneAwareCluster ...
+func NewZoneAwareCluster() cluster.Cluster {
+	return &zoneAwareCluster{}
 }
 
-// NewRegistryAwareCluster returns a registry aware cluster instance
-func NewRegistryAwareCluster() cluster.Cluster {
-	return &registryAwareCluster{}
+func (cluster *zoneAwareCluster) Join(directory cluster.Directory) protocol.Invoker {
+	return newZoneAwareClusterInvoker(directory)
 }
 
-// nolint
-func (cluster *registryAwareCluster) Join(directory cluster.Directory) protocol.Invoker {
-	return newRegistryAwareClusterInvoker(directory)
+func GetZoneAwareName() string {

Review comment:
       // nolint

##########
File path: cluster/cluster_impl/zone_aware_cluster.go
##########
@@ -23,18 +23,23 @@ import (
 	"github.com/apache/dubbo-go/protocol"
 )
 
-type registryAwareCluster struct{}
+type zoneAwareCluster struct{}
+
+const zoneAware = "zoneAware"
 
 func init() {
-	extension.SetCluster("registryAware", NewRegistryAwareCluster)
+	extension.SetCluster(zoneAware, NewZoneAwareCluster)
+}
+
+// NewZoneAwareCluster ...

Review comment:
       ```suggestion
   // nolint
   ```




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

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