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/06/24 08:30:57 UTC

[GitHub] [dubbo-go] willson-chen opened a new pull request #629: Add anyhost key judgment

willson-chen opened a new pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629


   <!--  Thanks for sending a pull request! 
   -->
   
   **What this PR does**:
   
   Add anyhost judgment in ToConfigurators in registry/base_configuration_listener.go, which is used to improve code quality by remove 'TODO' comment
   
   **Which issue(s) this PR fixes**:
   <!--
   *Automatically closes linked issue when PR is merged.
   Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
   _If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
   -->
   Fixes #
   
   **Special notes for your reviewer**:
   
   **Does this PR introduce a user-facing change?**:
   <!--
   If no, just write "NONE" in the release-note block below.
   If yes, a release note is required:
   Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
   -->
   ```release-note
   NONE
   ```


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


[GitHub] [dubbo-go] willson-chen commented on pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
willson-chen commented on pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#issuecomment-653038657


   Sorry for my lateness. Change request done.


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


[GitHub] [dubbo-go] AlexStocks merged pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
AlexStocks merged pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629


   


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


[GitHub] [dubbo-go] willson-chen commented on a change in pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
willson-chen commented on a change in pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#discussion_r446538102



##########
File path: registry/base_configuration_listener.go
##########
@@ -100,7 +100,13 @@ func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.C
 			configurators = []config_center.Configurator{}
 			break
 		}
-		//TODO:anyhost_key judage
+
+		override := url.GetParams()
+		delete(override, constant.ANYHOST_KEY)
+		if len(override) == 0 {
+			configurators = nil

Review comment:
       I am also puzzled by the java implememt that I follow. Could some one help to check it?




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


[GitHub] [dubbo-go] zouyx commented on a change in pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
zouyx commented on a change in pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#discussion_r445272374



##########
File path: registry/base_configuration_listener.go
##########
@@ -100,7 +100,13 @@ func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.C
 			configurators = []config_center.Configurator{}
 			break
 		}
-		//TODO:anyhost_key judage
+
+		override := url.GetParams()
+		delete(override, constant.ANYHOST_KEY)
+		if len(override) == 0 {
+			configurators = nil

Review comment:
       It seems will clear `configurators` when url.GetParams()  is nil. Is it right logic?
   Like:
   
   Fisrt loop: url.GetParams() is not null, add a element to `configurators`.
   Second loop :url.GetParams() is null ,will clear `configurators`?




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


[GitHub] [dubbo-go] willson-chen commented on pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
willson-chen commented on pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#issuecomment-648806717


   > Based on https://github.com/apache/dubbo-go/blob/master/contributing.md to change the title
   
   Thanks. I will pay attention to the rule in next PR.


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


[GitHub] [dubbo-go] AlexStocks commented on a change in pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#discussion_r444810107



##########
File path: registry/base_configuration_listener.go
##########
@@ -100,7 +100,13 @@ func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.C
 			configurators = []config_center.Configurator{}
 			break
 		}
-		//TODO:anyhost_key judage
+
+		var override map[string][]string = url.GetParams()

Review comment:
       override := url.GetParams()




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


[GitHub] [dubbo-go] willson-chen commented on a change in pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
willson-chen commented on a change in pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#discussion_r444877836



##########
File path: registry/base_configuration_listener.go
##########
@@ -100,7 +100,13 @@ func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.C
 			configurators = []config_center.Configurator{}
 			break
 		}
-		//TODO:anyhost_key judage
+
+		var override map[string][]string = url.GetParams()

Review comment:
       Done. Thanks. :)




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


[GitHub] [dubbo-go] zouyx commented on a change in pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
zouyx commented on a change in pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#discussion_r448394204



##########
File path: registry/base_configuration_listener.go
##########
@@ -100,7 +100,13 @@ func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.C
 			configurators = []config_center.Configurator{}
 			break
 		}
-		//TODO:anyhost_key judage
+
+		override := url.GetParams()
+		delete(override, constant.ANYHOST_KEY)
+		if len(override) == 0 {
+			configurators = nil

Review comment:
       > > It seems will clear configurators when url.GetParams() is nil. Is it right logic?
   > 
   > I think `configurators = nil` should be removed.
   
   Wilson will fix it.




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


[GitHub] [dubbo-go] zouyx commented on a change in pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
zouyx commented on a change in pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#discussion_r445272374



##########
File path: registry/base_configuration_listener.go
##########
@@ -100,7 +100,13 @@ func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.C
 			configurators = []config_center.Configurator{}
 			break
 		}
-		//TODO:anyhost_key judage
+
+		override := url.GetParams()
+		delete(override, constant.ANYHOST_KEY)
+		if len(override) == 0 {
+			configurators = nil

Review comment:
       It seems will clear `configurators` when url.GetParams()  is nil. Is it right logic?
   Like:
   
   Fisrt loop: url.GetParams() is not null, add a element to `configurators`.
   Second loop :url.GetParams() is null ,will clear `configurators`?
   Third loop :url.GetParams() is null , add a element to `configurators`?




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


[GitHub] [dubbo-go] willson-chen commented on pull request #629: Add anyhost key judgment

Posted by GitBox <gi...@apache.org>.
willson-chen commented on pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#issuecomment-648679880


   I removed the `TODO` comment and add the anyhost judgment, which follows the [java implement ](https://github.com/apache/dubbo/blob/b8b42b16182b8fde245dd6c5edeb1115955d1004/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Configurator.java#L86).


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


[GitHub] [dubbo-go] chickenlj commented on a change in pull request #629: Add: anyhost key judgment

Posted by GitBox <gi...@apache.org>.
chickenlj commented on a change in pull request #629:
URL: https://github.com/apache/dubbo-go/pull/629#discussion_r448118247



##########
File path: registry/base_configuration_listener.go
##########
@@ -100,7 +100,13 @@ func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.C
 			configurators = []config_center.Configurator{}
 			break
 		}
-		//TODO:anyhost_key judage
+
+		override := url.GetParams()
+		delete(override, constant.ANYHOST_KEY)
+		if len(override) == 0 {
+			configurators = nil

Review comment:
       > It seems will clear configurators when url.GetParams() is nil. Is it right logic?
   
   I think `configurators  = nil` should be removed.




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