Skip to content

Commit 6619560

Browse files
fix: conflict
2 parents 329a292 + f7ae84a commit 6619560

File tree

12 files changed

+102
-865
lines changed

12 files changed

+102
-865
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/coreos/etcd v3.3.25+incompatible
1414
github.com/creasty/defaults v1.5.1
1515
github.com/dubbogo/go-zookeeper v1.0.3
16-
github.com/dubbogo/gost v1.11.2
16+
github.com/dubbogo/gost v1.11.3
1717
github.com/dubbogo/triple v0.0.0-20210403061850-372f2dc47e02
1818
github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect
1919
github.com/emicklei/go-restful/v3 v3.4.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ github.com/dubbogo/go-zookeeper v1.0.3 h1:UkuY+rBsxdT7Bs63QAzp9z7XqQ53W1j8E5rwl8
180180
github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c=
181181
github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8=
182182
github.com/dubbogo/gost v1.10.1/go.mod h1:+mQGS51XQEUWZP2JeGZTxJwipjRKtJO7Tr+FOg+72rI=
183-
github.com/dubbogo/gost v1.11.2 h1:NanyHmvzE1HrgI2T9H/jE/N1wkxFEj+IbM1A4RT9H7Q=
184183
github.com/dubbogo/gost v1.11.2/go.mod h1:3QQEj50QOhkWTERT785YZ5ZxIRGNdR11FCLP7FzHsMc=
184+
github.com/dubbogo/gost v1.11.3 h1:PSP9KQyuRJugmPLqC18MFgoIL0g1G4n/9FTKgQYjjbE=
185+
github.com/dubbogo/gost v1.11.3/go.mod h1:3QQEj50QOhkWTERT785YZ5ZxIRGNdR11FCLP7FzHsMc=
185186
github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU=
186187
github.com/dubbogo/net v0.0.2-0.20210326124702-e6a866993192 h1:CBEicrrVwR6u8ty+kL68ItxXVk1jaVYThrsx5ARhxUc=
187188
github.com/dubbogo/net v0.0.2-0.20210326124702-e6a866993192/go.mod h1:B6/ka3g8VzcyrmdCH4VkHP1K0aHeI37FmclS+TCwIBU=
@@ -194,7 +195,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m
194195
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
195196
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
196197
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
197-
github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0 h1:ZoRgc53qJCfSLimXqJDrmBhnt5GChDsExMCK7t48o0Y=
198198
github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
199199
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
200200
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=

metadata/report/etcd/report.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import (
2222
"time"
2323
)
2424

25+
import (
26+
gxetcd "github.com/dubbogo/gost/database/kv/etcd/v3"
27+
)
28+
2529
import (
2630
"github.com/apache/dubbo-go/common"
2731
"github.com/apache/dubbo-go/common/constant"
@@ -30,7 +34,6 @@ import (
3034
"github.com/apache/dubbo-go/metadata/identifier"
3135
"github.com/apache/dubbo-go/metadata/report"
3236
"github.com/apache/dubbo-go/metadata/report/factory"
33-
"github.com/apache/dubbo-go/remoting/etcdv3"
3437
)
3538

3639
const DEFAULT_ROOT = "dubbo"
@@ -43,7 +46,7 @@ func init() {
4346

4447
// etcdMetadataReport is the implementation of MetadataReport based etcd
4548
type etcdMetadataReport struct {
46-
client *etcdv3.Client
49+
client *gxetcd.Client
4750
root string
4851
}
4952

@@ -121,7 +124,7 @@ type etcdMetadataReportFactory struct{}
121124
func (e *etcdMetadataReportFactory) CreateMetadataReport(url *common.URL) report.MetadataReport {
122125
timeout, _ := time.ParseDuration(url.GetParam(constant.REGISTRY_TIMEOUT_KEY, constant.DEFAULT_REG_TIMEOUT))
123126
addresses := strings.Split(url.Location, ",")
124-
client, err := etcdv3.NewClient(etcdv3.MetadataETCDV3Client, addresses, timeout, 1)
127+
client, err := gxetcd.NewClient(gxetcd.MetadataETCDV3Client, addresses, timeout, 1)
125128
if err != nil {
126129
logger.Errorf("Could not create etcd metadata report. URL: %s,error:{%v}", url.String(), err)
127130
return nil

registry/etcdv3/registry.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
)
2727

2828
import (
29+
gxetcd "github.com/dubbogo/gost/database/kv/etcd/v3"
2930
perrors "github.com/pkg/errors"
3031
)
3132

@@ -50,20 +51,20 @@ func init() {
5051
type etcdV3Registry struct {
5152
registry.BaseRegistry
5253
cltLock sync.Mutex
53-
client *etcdv3.Client
54+
client *gxetcd.Client
5455
listenerLock sync.RWMutex
5556
listener *etcdv3.EventListener
5657
dataListener *dataListener
5758
configListener *configurationListener
5859
}
5960

6061
// Client gets the etcdv3 client
61-
func (r *etcdV3Registry) Client() *etcdv3.Client {
62+
func (r *etcdV3Registry) Client() *gxetcd.Client {
6263
return r.client
6364
}
6465

6566
// SetClient sets the etcdv3 client
66-
func (r *etcdV3Registry) SetClient(client *etcdv3.Client) {
67+
func (r *etcdV3Registry) SetClient(client *gxetcd.Client) {
6768
r.client = client
6869
}
6970

@@ -88,9 +89,9 @@ func newETCDV3Registry(url *common.URL) (registry.Registry, error) {
8889

8990
if err := etcdv3.ValidateClient(
9091
r,
91-
etcdv3.WithName(etcdv3.RegistryETCDV3Client),
92-
etcdv3.WithTimeout(timeout),
93-
etcdv3.WithEndpoints(strings.Split(url.Location, ",")...),
92+
gxetcd.WithName(gxetcd.RegistryETCDV3Client),
93+
gxetcd.WithTimeout(timeout),
94+
gxetcd.WithEndpoints(strings.Split(url.Location, ",")...),
9495
); err != nil {
9596
return nil, err
9697
}

registry/etcdv3/service_discovery.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626

2727
import (
2828
gxset "github.com/dubbogo/gost/container/set"
29+
gxetcd "github.com/dubbogo/gost/database/kv/etcd/v3"
2930
gxpage "github.com/dubbogo/gost/hash/page"
3031
"github.com/hashicorp/vault/sdk/helper/jsonutil"
3132
perrors "github.com/pkg/errors"
@@ -56,7 +57,7 @@ type etcdV3ServiceDiscovery struct {
5657
// descriptor is a short string about the basic information of this instance
5758
descriptor string
5859
// client is current Etcdv3 client
59-
client *etcdv3.Client
60+
client *gxetcd.Client
6061
// serviceInstance is current serviceInstance
6162
serviceInstance *registry.ServiceInstance
6263
// services is when register or update will add service name
@@ -307,9 +308,9 @@ func newEtcdV3ServiceDiscovery(name string) (registry.ServiceDiscovery, error) {
307308
logger.Infof("etcd address is: %v,timeout is:%s", remoteConfig.Address, timeout.String())
308309

309310
client := etcdv3.NewServiceDiscoveryClient(
310-
etcdv3.WithName(etcdv3.RegistryETCDV3Client),
311-
etcdv3.WithTimeout(timeout),
312-
etcdv3.WithEndpoints(strings.Split(remoteConfig.Address, ",")...),
311+
gxetcd.WithName(gxetcd.RegistryETCDV3Client),
312+
gxetcd.WithTimeout(timeout),
313+
gxetcd.WithEndpoints(strings.Split(remoteConfig.Address, ",")...),
313314
)
314315

315316
descriptor := fmt.Sprintf("etcd-service-discovery[%s]", remoteConfig.Address)

registry/zookeeper/registry.go

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func newZkRegistry(url *common.URL) (registry.Registry, error) {
7979
return nil, err
8080
}
8181

82+
r.WaitGroup().Add(1) //zk client start successful, then wg +1
8283
go zookeeper.HandleClientRestart(r)
8384

8485
r.listener = zookeeper.NewZkEventListener(r.client)

0 commit comments

Comments
 (0)