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

Address notification batch mode #741

Merged
merged 4 commits into from
Sep 10, 2020
Merged

Address notification batch mode #741

merged 4 commits into from
Sep 10, 2020

Conversation

beiwei30
Copy link
Member

@beiwei30 beiwei30 commented Sep 7, 2020

What this PR does:

Support address notification from registry center in batch mode, instead of omit from register center one by one. In this mode, we assume all events accumulated by registry center first, then registry center will notify the directory the complete list in batch mode.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@AlexStocks AlexStocks requested review from zouyx, pantianying, hxmhlt and Patrick0308 and removed request for zouyx and pantianying September 7, 2020 11:12
var oldInvokers []protocol.Invoker

// in batch mode, it is safe to remove since we have the complete list of events.
if events != nil && len(events) > 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

events != nil && len(events) > 1 ==> len(events) > 1

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@@ -242,7 +242,12 @@ func newOverrideSubscribeListener(overriderUrl *common.URL, invoker protocol.Inv
}

// Notify will be triggered when a service change notification is received.
func (nl *overrideSubscribeListener) Notify(event *registry.ServiceEvent) {
func (nl *overrideSubscribeListener) Notify(events ...*registry.ServiceEvent) {
if events == nil || len(events) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

events == nil || len(events) == 0 ==> len(events) == 0

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

Copy link
Contributor

@Patrick0308 Patrick0308 left a comment

Choose a reason for hiding this comment

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

Excellent, LGTM

registry/directory/directory.go Outdated Show resolved Hide resolved
registry/directory/directory.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

@zouyx zouyx added the improve Refactor or improve label Sep 10, 2020
@zouyx zouyx added this to the 1.5.2 milestone Sep 10, 2020
@zouyx zouyx merged commit e7d38aa into apache:develop Sep 10, 2020
@zouyx zouyx mentioned this pull request Sep 22, 2020
@zouyx zouyx modified the milestones: 1.5.2, v1.5.3 Sep 23, 2020
zouyx added a commit to zouyx/dubbo-go that referenced this pull request Sep 24, 2020
Address notification batch mode
# Conflicts:
#	registry/directory/directory.go
AlexStocks pushed a commit that referenced this pull request Apr 14, 2021
Address notification batch mode
# Conflicts:
#	registry/directory/directory.go
kzhan pushed a commit to kzhan/dubbo-go that referenced this pull request Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve Refactor or improve
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants