Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nacos MetadataReport implementation #522

Merged
merged 5 commits into from
Jun 7, 2020

Conversation

flycash
Copy link
Member

@flycash flycash commented May 19, 2020

What this PR does:

Implement MetadataReport based on Nacos

Fixes #446

@flycash flycash changed the title Nacos MetadataReport implementation (WIP)Nacos MetadataReport implementation May 19, 2020
@codecov-commenter
Copy link

codecov-commenter commented May 19, 2020

Codecov Report

Merging #522 into feature/dubbo-2.7.5 will increase coverage by 0.10%.
The diff coverage is 70.52%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           feature/dubbo-2.7.5     #522      +/-   ##
=======================================================
+ Coverage                66.06%   66.16%   +0.10%     
=======================================================
  Files                      203      204       +1     
  Lines                    10558    10610      +52     
=======================================================
+ Hits                      6975     7020      +45     
- Misses                    2909     2912       +3     
- Partials                   674      678       +4     
Impacted Files Coverage Δ
metadata/report/nacos/report.go 70.21% <70.21%> (ø)
registry/nacos/base_registry.go 75.00% <100.00%> (+4.26%) ⬆️
remoting/zookeeper/client.go 67.22% <0.00%> (-1.36%) ⬇️
remoting/kubernetes/watch.go 78.30% <0.00%> (-0.95%) ⬇️
remoting/kubernetes/listener.go 56.07% <0.00%> (ø)
protocol/dubbo/client.go 69.09% <0.00%> (+1.21%) ⬆️
cluster/cluster_impl/failback_cluster_invoker.go 80.64% <0.00%> (+2.15%) ⬆️
protocol/dubbo/pool.go 81.27% <0.00%> (+4.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9578fc0...d997d51. Read the comment docs.

@flycash flycash changed the title (WIP)Nacos MetadataReport implementation Nacos MetadataReport implementation May 29, 2020
@flycash flycash marked this pull request as ready for review May 29, 2020 14:22
metadata/report/nacos/report_test.go Outdated Show resolved Hide resolved
registry/nacos/base_registry.go Outdated Show resolved Hide resolved
Copy link
Contributor

@hxmhlt hxmhlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

metadata/report/nacos/report.go Show resolved Hide resolved
metadata/report/nacos/report.go Show resolved Hide resolved
remoting/nacos/builder.go Outdated Show resolved Hide resolved
remoting/nacos/builder.go Outdated Show resolved Hide resolved
ftry := &nacosMetadataReportFactory{}
extension.SetMetadataReportFactory("nacos", func() factory.MetadataReportFactory {
return ftry
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to provide a method named Newxxx?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we provide NewXXX method, the factory should be singleton and we need factoryInstance + factoryInitOnce, but using closure can simply the codes

Comment on lines 175 to 177
if err != nil {
logger.Errorf("The config is invalid: %s", cfg)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If error is not null .....then not return? Is it right logic?

And this method has not testcase to cover it .

@flycash flycash linked an issue Jun 7, 2020 that may be closed by this pull request
@flycash flycash merged commit 669301f into apache:feature/dubbo-2.7.5 Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align 2.7.5: NacosServiceDiscovery
6 participants