-
Notifications
You must be signed in to change notification settings - Fork 934
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
Ftr: Application-level Registry Model #604
Merged
Merged
Changes from 227 commits
Commits
Show all changes
230 commits
Select commit
Hold shift + click to select a range
6e574cc
Add:format dir
hxmhlt 79218a1
Mod:resolve conflict
hxmhlt 4cced63
Merge branch 'code_enhance_of_urlinit' into metadata_report
hxmhlt 485cd5f
Mod:format mod
hxmhlt 95b4658
align 2.7.8: direct event dispatcher
Patrick0308 259e3c1
dispatcher in extension
Patrick0308 8e2adc5
add unit test and move extension to observer
Patrick0308 357f536
fix import
Patrick0308 ea24b17
add default eventDispatch type and handle eventType is ptr
Patrick0308 690333b
Mod:resolve conflict
hxmhlt 2925dd3
modify some comments and optimize code
Patrick0308 a782838
optimize some code and fix imports
Patrick0308 8cc8060
Merge branch 'feature/dubbo-2.7.5' into metadata_report
hxmhlt 8c42b4c
In memory service discovery support
c15a725
Add in-memory service-discovery support
0b0fde8
Add: add exporter
hxmhlt 8d3329f
Merge branch 'develop' into metadata_report
hxmhlt a594afd
Merge pull request #470 from apache/develop
hxmhlt 6a9591a
Add:identifier ut
hxmhlt b3dddc8
Mod: move service name mapping
hxmhlt 863dd0f
Mod:make ut run
hxmhlt 207e246
Mod:resolve conflict
hxmhlt 74d6dd9
Mod:format
hxmhlt dc405a7
Add:liscense
hxmhlt 2622827
move global dispatcher to extension package
Patrick0308 ef06c72
Mod:dir rename
hxmhlt 045f7f5
Merge remote-tracking branch 'upstream/feature/dubbo-2.7.5' into alig…
Patrick0308 b30bea6
Merge remote-tracking branch 'upstream/feature/dubbo-2.7.5' into alig…
Patrick0308 eca5628
fix imports
Patrick0308 a8871fd
modify and add licenses
Patrick0308 5d380d0
Mod:import pkg rename
hxmhlt a4ee287
Merge pull request #455 from Patrick0308/align-2.7.5
flycash 7c20ad3
Merge branch 'feature/dubbo-2.7.5' of github.com:apache/dubbo-go into…
6707dfb
Fix format
f09c991
Add extensiong for metadata service
f580027
Mod:rw problem
hxmhlt 851966e
Merge branch 'feature/dubbo-2.7.5' into metadata_report
hxmhlt ace7899
Mod:rw problem
hxmhlt 4521e09
Mod:rw problem
hxmhlt 66aa1a0
Mod:rw problem
hxmhlt 422b678
Merge pull request #469 from flycash/inmemory-service-discovery
flycash ad995d8
Add:add for resolve rw
hxmhlt 5067dae
Mod:treeset to skiplist
hxmhlt f595f50
Mod:resolve conflict
hxmhlt 2ac672f
event_publishing_service_discovery.go init
Patrick0308 370681a
Merge pull request #471 from hxmhlt/metadata_report
flycash 5b10451
implement GetConfigKeysByGroup
c8920d3
Fix travis
ad18357
Merge pull request #1 from apache/feature/dubbo-2.7.5
lzp0412 5811136
Merge remote-tracking branch 'origin/feature/dubbo-2.7.5' into featur…
ae7d706
support service discovery registry
8022392
fix synthesizer bug
c556232
Merge pull request #475 from flycash/nacos-batch-bk
flycash 839e0dd
add EventPublishingServiceDiscovery constructor
Patrick0308 3189b65
Merge remote-tracking branch 'upstream/feature/dubbo-2.7.5' into even…
Patrick0308 530f563
Implement event dispatcher
71326c9
Merge branch 'feature/dubbo-2.7.5' of https://github.com/lzp0412/dubb…
9b41e95
Merge pull request #497 from flycash/2.7.5
flycash 682f405
Add dynamic
a5da721
rename service => service discovery
8b720aa
Merge develop
3aa0082
Merge pull request #2 from flycash/2.7.5-bk
lzp0412 569e2b6
1、add comments
59365ec
Merge develop
212d886
merge develop
6a558d8
Merge pull request #500 from flycash/2.7.5
zouyx ffe69ca
Merge branch 'feature/dubbo-2.7.5' of github.com:apache/dubbo-go into…
08eb340
Export get BaseConfig
bcda4de
fix review comments
698c2b2
Merge remote-tracking branch 'remotes/dubbo-go/feature/dubbo-2.7.5' i…
4b8b4d7
Refactor service-discovery
1113bf1
Merge 2.7.5
3f1a52b
Merge pull request #4 from flycash/2.7.5-bk
lzp0412 62b3787
add interface for unregister and unsubscribe
zouyx a784557
Add tests
266e0b6
Add extensiong for metadata service
ed5693f
Merge pull request #5 from flycash/2.7.5-bk
lzp0412 a4cef09
Merge remote-tracking branch 'upstream/feature/dubbo-2.7.5' into even…
Patrick0308 99ac8c5
add Event
Patrick0308 b87dbe2
Add:metadata report delegate & remote metadata service
hxmhlt 73f21fa
Mod:for ut
hxmhlt f7dd531
Mod:resolve conflict
hxmhlt 2938f51
optimize code
Patrick0308 ada27e2
add unit tests and modify event struct
Patrick0308 9f7e1f3
fix imports
Patrick0308 3e81841
add unregister for Registry and FacadeBasedRegistry
zouyx df74f8d
add test case for Registry unregister
zouyx 4970301
modify test case for Registry unregister
zouyx 69ace5e
modify test case for Registry unregister
zouyx e73f3bf
fix impl_test error
322eb5f
add Registry unsubscribe
zouyx c958389
Merge pull request #487 from Patrick0308/eventDispatchServiceDiscovery
zouyx 393d12a
fix import error
31f8663
change lock granularity
zouyx 341bc5f
add panic for not support implement
zouyx aaeabc6
fix import error
f1d5aa4
fix review problems
zouyx 1b55d1e
Merge branch 'develop' into feature/addRegistryUnpub
zouyx ce89e9b
fix review comments
zouyx 50c24b1
fix review comments
zouyx f3a7845
add comment and test case
zouyx 9788244
Merge remote-tracking branch 'apache/feature/dubbo-2.7.5' into metada…
hxmhlt 0048609
Mod:resolve pr review
hxmhlt 235edf5
Mod:resolve pr review
hxmhlt 7a87b5a
fix review comments
zouyx ab046ef
fix review comments
zouyx 2699fcc
fix review problems
zouyx f0c9c8f
fix review problems
zouyx df1a43d
Finish code
7e7db7b
fix review problems
zouyx 9026120
Merge pull request #510 from zouyx/feature/addRegistryUnpub
AlexStocks 5c767f4
change subscribe service key in registrydatalistener
zouyx c21d928
change to service key
zouyx 3094ef8
Merge pull request #535 from zouyx/feature/addRegistryUnpub
zouyx c312cc8
Mod:modify for code review
hxmhlt 0d78b2a
Mod:for code review
hxmhlt c024ce1
Mod:code review
hxmhlt d4c83fb
Merge pull request #505 from hxmhlt/metadata_report
AlexStocks b364f31
change test case method
zouyx 9578fc0
Merge pull request #542 from zouyx/feature/addRegistryUnpub
Patrick0308 7c87c2a
Merge branch 'feature/dubbo-2.7.5' of https://github.com/apache/dubbo…
flycash bdd9b71
Add UT
flycash 198ddc3
Merge nacos-meta
flycash 7e912e7
Merge pull request #6 from flycash/2.7.5
lzp0412 b968f7b
Add unregiste implementation
flycash cc4d563
server start successfully
flycash bfb89b5
Merge pull request #8 from flycash/2.7.5
lzp0412 035d7d9
Fix bug: using EventPublishServiceDiscovery
flycash f993803
Merge develop
flycash 34775e5
Merge pull request #9 from flycash/2.7.5-bk
lzp0412 e499d1c
lock optimize
zouyx 3ae2a82
revert changes for CloseAndNilClient
zouyx 977fffa
lock optimize
zouyx 9c623ec
revert changes for registerTempZookeeperNode
zouyx f7ea5f2
lock optimize
zouyx db059d3
lock optimize : change to rwlock
zouyx 1d1bbe0
lock optimize : change to rwlock
zouyx 5f0084a
Fix review
flycash b760621
Add events and eventListener
flycash 9ae184f
extract method for get zookeeper connection
zouyx ff9eec7
Merge pull request #578 from zouyx/feature/addRegistryUnpub
AlexStocks ed6b59b
Add events and eventListener
flycash e2da137
Add customizer
flycash 59eee39
Add customizer
flycash d997d51
fix review
flycash b815070
code clean
efd2305
fix
2398d20
fix log
2997c11
refactor MetadataService
flycash 4f382b0
test: assert --> require to use fail now
a7c2c8b
add lock for event registry map to avoid concurrent read write
669301f
Merge pull request #522 from flycash/nacos-meta
flycash 16b6500
it can be found by java consumer
flycash a7d16a0
Resolve conflict
flycash 3984ffa
Merge branch 'feature/dubbo-2.7.5' into 2.7.5-bk
lzp0412 066dcdd
Add metadata service factory
flycash 61a5188
Merge branch '2.7.5-bk' of github.com:flycash/dubbo-go into 2.7.5-bk
flycash 9d5d9e3
Invoke dubbo client success
flycash e6c92b9
Merge branch 'feature/dubbo-2.7.5' into zk_client
c6e8b0c
Fix BUG
flycash ca020d2
Fix BUG
flycash 9eddc5c
Merge 2.7.5
flycash e8ca163
Merge 2.7.5
flycash 8793dab
add code for etcd metadata report
pantianying 287da82
Merge develop
flycash d6a68d5
Fix Review And Add UT
flycash 94636fc
add test code
pantianying 05a6146
fix go fmt
pantianying df758dc
require --> assert
0965296
Merge pull request #1 from pantianying/etcd_metadata_report
flycash 760fc22
Fix Review And UT
flycash c19f65b
Merge branch '2.7.5-bk' of github.com:flycash/dubbo-go into 2.7.5-bk
flycash 024f7b2
Merge pull request #601 from dubbo-x/zk_client
AlexStocks 85607f2
Merge pull request #4 from flycash/2.7.5-bk
xianlezheng b83f86a
Fix Review And Add UT
flycash 904bbdb
Merge develop
flycash 0b6cbef
Ftr:EtcdServiceDiscovery #423
xianlezheng 8eb8caa
Ftr: add EtcdServiceDiscovery
xianlezheng b242ae3
Merge pull request #7 from flycash/2.7.5-bk
xianlezheng 819d092
fix:merge update dubbo-2.7.5 branch to feature/etcd-service-discovery
xianlezheng 28057ed
Merge pull request #3 from xianlezheng/feature/etcd-service-discovery
flycash e3d7770
Fix UT
flycash 80411a4
Merge develop
flycash facab2b
Fix Etcd BUG
flycash e91bf07
Merge pull request #8 from flycash/2.7.5-bk
xianlezheng 5aaee6d
Fix: EtcdServiceDiscovery replace put with temp kv.
xianlezheng be56ab1
Merge pull request #5 from xianlezheng/feature/etcd-service-discovery
flycash 3d0b1c9
modify metareport interface
b08b8fc
zookeeper's service_discovery
Patrick0308 b8f5346
fix bug
b2a04fd
consul metadata report
117f85f
zookeeper metadata report
f1576d1
fix
242e9f2
fix
81a458c
import sort
404cd00
consul metadata report unit test
4e782b3
zookeeper's service_discovery modify
Patrick0308 c066b50
zookeeper's service_discovery modify
Patrick0308 30ca089
Merge remote-tracking branch 'upstream/feature/dubbo-2.7.5' into zk-s…
Patrick0308 7ac57ce
zookeeper's service_discovery fix
Patrick0308 f004237
zookeeper metadata report unit test
ecf7fa1
go fmt
ae1df23
add comment and adjust service_discovery's critical area
Patrick0308 3c3552c
modify comment
Patrick0308 44dbdfe
global var for empty slice
dd6e4bd
add unit tests
Patrick0308 c2e00e5
Merge remote-tracking branch 'flycash/2.7.5-bk' into zk-servicediscovery
Patrick0308 f440a31
fix
e030e25
remove panic
a601a33
fix bug
f00d104
rename consul agent for test
a23c6d2
fix
7248544
fix typo
f66dda8
update zk library version
302dbc2
simplify and comment
8906429
add CreateTempWithValue in zookeeper client
Patrick0308 5a12137
Merge pull request #633 from dubbo-x/metadata
pantianying 8ad299c
Merge zk and consul
flycash 3fd1b2d
Merge develop
flycash e90fac6
Merge zk discovery
flycash 9a5990d
Fix ZK BUG
flycash 822f1a2
Add Release Notes
flycash d28ae76
Remove comments
flycash 750e62d
Resolve conflict
flycash f433c06
Merge branch '2.7.5-bk' of github.com:flycash/dubbo-go into 2.7.5-bk
flycash 744afb2
Fix Review
flycash 762e45e
Fix Review
flycash 4140d5d
fix travis
zouyx 4c00837
fix review comment
zouyx 2f73ae5
fix review comment
zouyx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,12 @@ const ( | |
) | ||
|
||
const ( | ||
PORT_KEY = "port" | ||
GROUP_KEY = "group" | ||
VERSION_KEY = "version" | ||
INTERFACE_KEY = "interface" | ||
PATH_KEY = "path" | ||
PROTOCOL_KEY = "protocol" | ||
SERVICE_KEY = "service" | ||
METHODS_KEY = "methods" | ||
TIMEOUT_KEY = "timeout" | ||
|
@@ -40,6 +42,7 @@ const ( | |
TOKEN_KEY = "token" | ||
LOCAL_ADDR = "local-addr" | ||
REMOTE_ADDR = "remote-addr" | ||
PATH_SEPARATOR = "/" | ||
DUBBO_KEY = "dubbo" | ||
RELEASE_KEY = "release" | ||
ANYHOST_KEY = "anyhost" | ||
|
@@ -77,6 +80,11 @@ const ( | |
EXECUTE_REJECTED_EXECUTION_HANDLER_KEY = "execute.limit.rejected.handler" | ||
PROVIDER_SHUTDOWN_FILTER = "pshutdown" | ||
CONSUMER_SHUTDOWN_FILTER = "cshutdown" | ||
PID_KEY = "pid" | ||
SYNC_REPORT_KEY = "sync.report" | ||
RETRY_PERIOD_KEY = "retry.period" | ||
RETRY_TIMES_KEY = "retry.times" | ||
CYCLE_REPORT_KEY = "cycle.report" | ||
) | ||
|
||
const ( | ||
|
@@ -155,6 +163,14 @@ const ( | |
NACOS_USERNAME = "username" | ||
) | ||
|
||
const ( | ||
ZOOKEEPER_KEY = "zookeeper" | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the constant into zookeeper 's directory. |
||
|
||
const ( | ||
ETCDV3_KEY = "etcdv3" | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the constant into etcd 's directory. |
||
|
||
const ( | ||
TRACING_REMOTE_SPAN_CTX = "tracing.remote.span.ctx" | ||
) | ||
|
@@ -230,7 +246,6 @@ const ( | |
KEY_SEPARATOR = ":" | ||
DEFAULT_PATH_TAG = "metadata" | ||
KEY_REVISON_PREFIX = "revision" | ||
PATH_SEPARATOR = "/" | ||
|
||
// metadata service | ||
METADATA_SERVICE_NAME = "org.apache.dubbo.metadata.MetadataService" | ||
|
@@ -259,7 +274,19 @@ const ( | |
) | ||
|
||
// service discovery | ||
|
||
const ( | ||
NACOS_GROUP = "nacos.group" | ||
SUBSCRIBED_SERVICE_NAMES_KEY = "subscribed-services" | ||
PROVIDER_BY = "provided-by" | ||
EXPORTED_SERVICES_REVISION_PROPERTY_NAME = "dubbo.exported-services.revision" | ||
SUBSCRIBED_SERVICES_REVISION_PROPERTY_NAME = "dubbo.subscribed-services.revision" | ||
SERVICE_INSTANCE_SELECTOR = "service-instance-selector" | ||
METADATA_STORAGE_TYPE_PROPERTY_NAME = "dubbo.metadata.storage-type" | ||
DEFAULT_METADATA_STORAGE_TYPE = "local" | ||
SERVICE_INSTANCE_ENDPOINTS = "dubbo.endpoints" | ||
METADATA_SERVICE_PREFIX = "dubbo.metadata-service." | ||
METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME = METADATA_SERVICE_PREFIX + "url-params" | ||
METADATA_SERVICE_URLS_PROPERTY_NAME = METADATA_SERVICE_PREFIX + "urls" | ||
|
||
// SERVICE_DISCOVERY_KEY indicate which service discovery instance will be used | ||
SERVICE_DISCOVERY_KEY = "service_discovery" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package extension | ||
|
||
import ( | ||
"sync" | ||
flycash marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
|
||
flycash marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import ( | ||
"github.com/apache/dubbo-go/common/logger" | ||
"github.com/apache/dubbo-go/common/observer" | ||
) | ||
|
||
var ( | ||
globalEventDispatcher observer.EventDispatcher | ||
initEventListeners []func() observer.EventListener | ||
initEventOnce sync.Once | ||
) | ||
|
||
var ( | ||
dispatchers = make(map[string]func() observer.EventDispatcher, 8) | ||
) | ||
|
||
// SetEventDispatcher, actually, it doesn't really init the global dispatcher | ||
func SetEventDispatcher(name string, v func() observer.EventDispatcher) { | ||
dispatchers[name] = v | ||
} | ||
|
||
// SetAndInitGlobalDispatcher will actually init the global dispatcher | ||
// if there is already a global dispatcher, | ||
// it will be override | ||
// if the dispatcher with the name not found, it will panic | ||
func SetAndInitGlobalDispatcher(name string) { | ||
if len(name) == 0 { | ||
name = "direct" | ||
} | ||
if globalEventDispatcher != nil { | ||
logger.Warnf("EventDispatcher has been initialized. It will be replaced") | ||
} | ||
|
||
if dp, ok := dispatchers[name]; !ok || dp == nil { | ||
panic("EventDispatcher for " + name + " is not found, make sure you have import the package, " + | ||
"like import _ github.com/apache/dubbo-go/common/observer/dispatcher ") | ||
} | ||
globalEventDispatcher = dispatchers[name]() | ||
} | ||
|
||
// GetGlobalDispatcher will init all listener and then return dispatcher | ||
func GetGlobalDispatcher() observer.EventDispatcher { | ||
initEventOnce.Do(func() { | ||
// we should delay to add the listeners to avoid some listeners left | ||
flycash marked this conversation as resolved.
Show resolved
Hide resolved
|
||
for _, l := range initEventListeners { | ||
globalEventDispatcher.AddEventListener(l()) | ||
} | ||
}) | ||
return globalEventDispatcher | ||
} | ||
|
||
// AddEventListener it will be added in global event dispatcher | ||
func AddEventListener(creator func() observer.EventListener) { | ||
initEventListeners = append(initEventListeners, creator) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the constant into nacos's directory.