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/21 15:48:16 UTC

[GitHub] [dubbo-go] zouyx opened a new pull request #670: Fix: apollo data change listener

zouyx opened a new pull request #670:
URL: https://github.com/apache/dubbo-go/pull/670


   <!--  Thanks for sending a pull request! 
   -->
   
   **What this PR does**:
   
   * update apollo client
   * fix data change listener problem
   
   **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
   
   ```


----------------------------------------------------------------
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 #670: Fix: apollo data change listener

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


   


----------------------------------------------------------------
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 #670: Fix: apollo data change listener

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



##########
File path: config_center/apollo/listener.go
##########
@@ -18,34 +18,48 @@
 package apollo
 
 import (
-	"github.com/zouyx/agollo"
+	"github.com/zouyx/agollo/v3"
+	"github.com/zouyx/agollo/v3/storage"
+	"gopkg.in/yaml.v2"
 )
 
 import (
+	"github.com/apache/dubbo-go/common/logger"
 	"github.com/apache/dubbo-go/config_center"
+	"github.com/apache/dubbo-go/remoting"
 )
 
 type apolloListener struct {
 	listeners map[config_center.ConfigurationListener]struct{}
 }
 
-// NewApolloListener ...
-func NewApolloListener() *apolloListener {
+// newApolloListener ...
+func newApolloListener() *apolloListener {

Review comment:
       // 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


[GitHub] [dubbo-go] AlexStocks commented on pull request #670: Fix: apollo data change listener

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on pull request #670:
URL: https://github.com/apache/dubbo-go/pull/670#issuecomment-663807446


   Pls merge the latest develop branch codes to fix the travis failure.


----------------------------------------------------------------
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] codecov-commenter commented on pull request #670: Fix: apollo data change listener

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #670:
URL: https://github.com/apache/dubbo-go/pull/670#issuecomment-664155090


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/670?src=pr&el=h1) Report
   > Merging [#670](https://codecov.io/gh/apache/dubbo-go/pull/670?src=pr&el=desc) into [1.4](https://codecov.io/gh/apache/dubbo-go/commit/428fe1a9dc40e015c50faf5a70cb81f9d83ebdc4&el=desc) will **decrease** coverage by `0.29%`.
   > The diff coverage is `82.60%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/670/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/670?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##              1.4     #670      +/-   ##
   ==========================================
   - Coverage   67.11%   66.81%   -0.30%     
   ==========================================
     Files         174      174              
     Lines        9259     9257       -2     
   ==========================================
   - Hits         6214     6185      -29     
   - Misses       2434     2460      +26     
   - Partials      611      612       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/670?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [config\_center/apollo/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/670/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9hcG9sbG8vbGlzdGVuZXIuZ28=) | `82.60% <73.33%> (-17.40%)` | :arrow_down: |
   | [config\_center/apollo/impl.go](https://codecov.io/gh/apache/dubbo-go/pull/670/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9hcG9sbG8vaW1wbC5nbw==) | `85.50% <100.00%> (-1.51%)` | :arrow_down: |
   | [config\_center/nacos/facade.go](https://codecov.io/gh/apache/dubbo-go/pull/670/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9uYWNvcy9mYWNhZGUuZ28=) | `37.50% <0.00%> (-34.38%)` | :arrow_down: |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/670/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `56.07% <0.00%> (-6.55%)` | :arrow_down: |
   | [config\_center/nacos/client.go](https://codecov.io/gh/apache/dubbo-go/pull/670/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9uYWNvcy9jbGllbnQuZ28=) | `65.74% <0.00%> (-1.86%)` | :arrow_down: |
   | [protocol/dubbo/client.go](https://codecov.io/gh/apache/dubbo-go/pull/670/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vY2xpZW50Lmdv) | `67.87% <0.00%> (-1.22%)` | :arrow_down: |
   | [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/670/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `78.30% <0.00%> (-0.95%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/670?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/670?src=pr&el=footer). Last update [428fe1a...491edb6](https://codecov.io/gh/apache/dubbo-go/pull/670?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 #670: Fix: apollo data change listener

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



##########
File path: config_center/apollo/listener.go
##########
@@ -18,34 +18,48 @@
 package apollo
 
 import (
-	"github.com/zouyx/agollo"
+	"github.com/zouyx/agollo/v3"
+	"github.com/zouyx/agollo/v3/storage"
+	"gopkg.in/yaml.v2"
 )
 
 import (
+	"github.com/apache/dubbo-go/common/logger"
 	"github.com/apache/dubbo-go/config_center"
+	"github.com/apache/dubbo-go/remoting"
 )
 
 type apolloListener struct {
 	listeners map[config_center.ConfigurationListener]struct{}
 }
 
-// NewApolloListener ...
-func NewApolloListener() *apolloListener {
+// newApolloListener ...
+func newApolloListener() *apolloListener {
 	return &apolloListener{
 		listeners: make(map[config_center.ConfigurationListener]struct{}, 0),
 	}
 }
 
 // OnChange ...
-func (a *apolloListener) OnChange(changeEvent *agollo.ChangeEvent) {
-	for key, change := range changeEvent.Changes {
-		for listener := range a.listeners {
-			listener.Process(&config_center.ConfigChangeEvent{
-				ConfigType: getChangeType(change.ChangeType),
-				Key:        key,
-				Value:      change.NewValue,
-			})
-		}
+func (a *apolloListener) OnChange(changeEvent *storage.ChangeEvent) {
+
+}
+
+// OnNewestChange ...

Review comment:
       Pls do not use "..." as comment again.




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