Skip to content

Commit 42618b8

Browse files
authored
Refactor providerdata process (#64)
* Update Travis CI Link Address Update Travis CI Link Address * Fix issue24 (#41) * fix temp push * update version 5.2.1-SNAPSHOT * fix test case * fix jetty version,and fix rest api for dataInfoIds * fix hashcode test * fix working to init bug * fix start task log * fix Watcher can't get providate data,retry and finally return new * add data server list api * add server list api * remove log * fix isssue 21 * add query by id function * fix issue 22 * delay client off process and sync data process to working status * fix data connet meta error * fix inject NotifyDataSyncHandler * fix start log * add send sub log * fix subscriber to send log * fix word cache clientid * add clientoff delay time * fix clientOffDelayMs * fix jetty version * fix version to 5.2.1 release * fix version * fix .travis.yml * fix test case * fix * fix test sync case * fix test case * fix test case * fix case * fix notify online no connect break,and add connect log * add test case * add test case * fix test case * fix format * fix resource test case * fix * Upgrade version to 5.2.1 for release (#40) * Fix version 521 (#42) * fix temp push * update version 5.2.1-SNAPSHOT * fix test case * fix jetty version,and fix rest api for dataInfoIds * fix hashcode test * fix working to init bug * fix start task log * fix Watcher can't get providate data,retry and finally return new * add data server list api * add server list api * remove log * fix isssue 21 * add query by id function * fix issue 22 * delay client off process and sync data process to working status * fix data connet meta error * fix inject NotifyDataSyncHandler * fix start log * add send sub log * fix subscriber to send log * fix word cache clientid * add clientoff delay time * fix clientOffDelayMs * fix jetty version * fix version to 5.2.1 release * fix version to 5.2.1 for release * fix version * fix .travis.yml * fix test case * fix * fix test sync case * fix test case * fix test case * fix case * fix notify online no connect break,and add connect log * add test case * add test case * fix test case * fix format * fix resource test case * fix * remove data numberOfReplicas * fix jraft version 1.2.5 * fix push confirm error,and fix datum update version,pub threadpool config,add accesslimit service * add switch renew and expire * implement renew enable/disable switch * fix data client exechange log * fix datum fetch connect error * bugfix CacheService: set version zero when first sub and get datum error * fix clean task for fetch * bugfix DatumCache: Forget to clean up the index in datumCache.putSnapshot * fix fetch datum word cache * fix test case time * fix test cast * fix test case * fix tast case * fix ut case: StopPushDataSwitchTest * ut case:renew module * fix ut case:TempPublisherTest * fix version,and merge new * bugfix ut case: increase sleep time * fix ut case:RenewTest * fix version and fix callback executor,fix log error * fix ut case:RenewTest format * fix pom version * fix ut case:do not run parallelly * refactor providerdata process
1 parent 7309bd7 commit 42618b8

File tree

101 files changed

+3220
-599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+3220
-599
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ sudo: false
44
dist: trusty
55

66
jdk:
7-
- oraclejdk8
7+
- oraclejdk8
88

99
install:
10-
- mvn clean install -DskipTests -B -V
11-
- mvn test
10+
- mvn clean install -DskipTests -B -V
11+
- mvn test
1212

1313
script:
14-
- sh ./tools/check_format.sh
14+
- sh ./tools/check_format.sh
1515

1616
after_success:
17-
- bash <(curl -s https://codecov.io/bash)
17+
- bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# SOFARegistry
22

3-
[![Build Status](https://travis-ci.com/alipay/sofa-registry.svg?branch=master)](https://travis-ci.com/alipay/sofa-registry)
3+
[![Build Status](https://travis-ci.com/alipay/sofa-registry.svg?branch=master)](https://travis-ci.com/sofastack/sofa-registry)
44
![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)
5-
[![Coverage Status](https://codecov.io/gh/alipay/sofa-registry/branch/master/graph/badge.svg)](https://codecov.io/gh/alipay/sofa-registry)
6-
![maven](https://img.shields.io/github/release/alipay/sofa-registry.svg)
5+
[![Coverage Status](https://codecov.io/gh/alipay/sofa-registry/branch/master/graph/badge.svg)](https://codecov.io/gh/sofastack/sofa-registry)
6+
![maven](https://img.shields.io/github/release/sofastack/sofa-registry.svg)
77

88
SOFARegistry 是蚂蚁金服开源的一个生产级、高时效、高可用的服务注册中心。SOFARegistry 最早源自于淘宝的 ConfigServer,十年来,随着蚂蚁金服的业务发展,注册中心架构已经演进至第五代。目前 SOFARegistry 不仅全面服务于蚂蚁金服的自有业务,还随着蚂蚁金融科技服务众多合作伙伴,同时也兼容开源生态。SOFARegistry 采用 AP 架构,支持秒级时效性推送,同时采用分层架构支持无限水平扩展。
99

client/all/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.alipay.sofa</groupId>
88
<artifactId>registry-client-all</artifactId>
9-
<version>5.3.0-SNAPSHOT</version>
9+
<version>5.3.1-SNAPSHOT</version>
1010

1111
<name>${project.groupId}:${project.artifactId}</name>
1212
<url>http://github.com/alipay/sofa-registry</url>

client/api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.alipay.sofa</groupId>
77
<artifactId>registry-client-parent</artifactId>
8-
<version>5.3.0-SNAPSHOT</version>
8+
<version>5.3.1-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

client/impl/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.alipay.sofa</groupId>
77
<artifactId>registry-client-parent</artifactId>
8-
<version>5.3.0-SNAPSHOT</version>
8+
<version>5.3.1-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

client/impl/src/test/java/com/alipay/sofa/registry/client/provider/DefaultRegistryClientTest.java

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616
*/
1717
package com.alipay.sofa.registry.client.provider;
1818

19+
import static org.junit.Assert.assertEquals;
20+
import static org.junit.Assert.assertNotNull;
21+
import static org.junit.Assert.assertNull;
22+
import static org.junit.Assert.assertTrue;
23+
import static org.mockito.Mockito.mock;
24+
25+
import org.junit.After;
26+
import org.junit.Test;
27+
import org.slf4j.Logger;
28+
import org.slf4j.LoggerFactory;
29+
1930
import com.alipay.sofa.registry.client.api.ConfigDataObserver;
2031
import com.alipay.sofa.registry.client.api.Configurator;
2132
import com.alipay.sofa.registry.client.api.Publisher;
@@ -31,16 +42,6 @@
3142
import com.alipay.sofa.registry.core.model.PublisherRegister;
3243
import com.alipay.sofa.registry.core.model.ScopeEnum;
3344
import com.alipay.sofa.registry.core.model.SubscriberRegister;
34-
import org.junit.After;
35-
import org.junit.Test;
36-
import org.slf4j.Logger;
37-
import org.slf4j.LoggerFactory;
38-
39-
import static org.junit.Assert.assertEquals;
40-
import static org.junit.Assert.assertNotNull;
41-
import static org.junit.Assert.assertNull;
42-
import static org.junit.Assert.assertTrue;
43-
import static org.mockito.Mockito.mock;
4445

4546
/**
4647
* The type Default registry client test.
@@ -89,7 +90,7 @@ public void registerPublisher() throws InterruptedException {
8990

9091
defaultPublisher.republish("republish test");
9192

92-
Thread.sleep(500L);
93+
Thread.sleep(2000L);
9394
// register success when republish
9495
assertTrue(defaultPublisher.isRegistered());
9596
}
@@ -111,7 +112,7 @@ public void handleData(String dataId, UserData data) {
111112
assertNotNull(subscriber);
112113
assertEquals(dataId, subscriber.getDataId());
113114

114-
Thread.sleep(500L);
115+
Thread.sleep(2000L);
115116

116117
RegisterCache registerCache = registryClient.getRegisterCache();
117118

@@ -142,7 +143,7 @@ public void handleData(String dataId, ConfigData configData) {
142143
assertNotNull(configurator);
143144
assertEquals(dataId, configurator.getDataId());
144145

145-
Thread.sleep(500L);
146+
Thread.sleep(2000L);
146147

147148
RegisterCache registerCache = registryClient.getRegisterCache();
148149

@@ -164,7 +165,7 @@ public void unregisterSinglePublisherTest() throws InterruptedException {
164165
int unregisterCount = registryClient.unregister(dataId, null, RegistryType.PUBLISHER);
165166
assertEquals(1, unregisterCount);
166167

167-
Thread.sleep(500L);
168+
Thread.sleep(2000L);
168169

169170
Publisher temp = registryClient.getRegisterCache().getPublisherByRegistId(
170171
publisher.getRegistId());
@@ -185,7 +186,7 @@ public void unregisterSingleSubscriberTest() throws InterruptedException {
185186
int unregisterCount = registryClient.unregister(dataId, null, RegistryType.SUBSCRIBER);
186187
assertEquals(1, unregisterCount);
187188

188-
Thread.sleep(500L);
189+
Thread.sleep(2000L);
189190

190191
Subscriber temp = registryClient.getRegisterCache().getSubscriberByRegistId(
191192
subscriber.getRegistId());
@@ -206,7 +207,7 @@ public void unregisterSingleConfiguratorTest() throws InterruptedException {
206207
int unregisterCount = registryClient.unregister(dataId, null, RegistryType.CONFIGURATOR);
207208
assertEquals(1, unregisterCount);
208209

209-
Thread.sleep(500L);
210+
Thread.sleep(2000L);
210211

211212
Subscriber temp = registryClient.getRegisterCache().getSubscriberByRegistId(
212213
configurator.getRegistId());
@@ -236,13 +237,13 @@ public void unregisterMultiTest() throws InterruptedException {
236237

237238
Subscriber subscriber2 = registryClient.register(subscriberRegistration2);
238239

239-
Thread.sleep(500L);
240+
Thread.sleep(2000L);
240241

241242
// 2. unregister publisher
242243
int unregisterCount = registryClient.unregister(dataId, null, RegistryType.PUBLISHER);
243244
assertEquals(2, unregisterCount);
244245

245-
Thread.sleep(500L);
246+
Thread.sleep(2000L);
246247

247248
// 3. check publisher register cache
248249
RegisterCache registerCache = registryClient.getRegisterCache();
@@ -256,7 +257,7 @@ public void unregisterMultiTest() throws InterruptedException {
256257
unregisterCount = registryClient.unregister(dataId, null, RegistryType.SUBSCRIBER);
257258
assertEquals(2, unregisterCount);
258259

259-
Thread.sleep(500L);
260+
Thread.sleep(2000L);
260261

261262
// 5. check subscriber register cache
262263
Subscriber tempSub = registerCache.getSubscriberByRegistId(subscriber1.getRegistId());

client/impl/src/test/java/com/alipay/sofa/registry/client/provider/RegisterOrderTest.java

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@
1616
*/
1717
package com.alipay.sofa.registry.client.provider;
1818

19+
import static org.junit.Assert.assertEquals;
20+
import static org.junit.Assert.assertFalse;
21+
import static org.junit.Assert.assertNotNull;
22+
import static org.junit.Assert.assertNull;
23+
import static org.junit.Assert.assertTrue;
24+
import static org.junit.Assert.fail;
25+
26+
import java.util.List;
27+
28+
import org.junit.After;
29+
import org.junit.Test;
30+
import org.slf4j.Logger;
31+
import org.slf4j.LoggerFactory;
32+
1933
import com.alipay.sofa.registry.client.api.Publisher;
2034
import com.alipay.sofa.registry.client.api.Subscriber;
2135
import com.alipay.sofa.registry.client.api.SubscriberDataObserver;
@@ -26,19 +40,6 @@
2640
import com.alipay.sofa.registry.core.model.DataBox;
2741
import com.alipay.sofa.registry.core.model.PublisherRegister;
2842
import com.alipay.sofa.registry.core.model.SubscriberRegister;
29-
import org.junit.After;
30-
import org.junit.Test;
31-
import org.slf4j.Logger;
32-
import org.slf4j.LoggerFactory;
33-
34-
import java.util.List;
35-
36-
import static org.junit.Assert.assertEquals;
37-
import static org.junit.Assert.assertFalse;
38-
import static org.junit.Assert.assertNotNull;
39-
import static org.junit.Assert.assertNull;
40-
import static org.junit.Assert.assertTrue;
41-
import static org.junit.Assert.fail;
4243

4344
/**
4445
*
@@ -126,7 +127,7 @@ public void publishAndUnregister() throws InterruptedException {
126127
// step 1
127128
Publisher publisher = registryClient.register(new PublisherRegistration(dataId), data);
128129

129-
Thread.sleep(500L);
130+
Thread.sleep(2000L);
130131

131132
String registId = publisher.getRegistId();
132133
PublisherRegister publisherRegister = mockServer.queryPubliser(registId);
@@ -137,7 +138,7 @@ public void publishAndUnregister() throws InterruptedException {
137138
// step 2
138139
publisher.unregister();
139140

140-
Thread.sleep(500L);
141+
Thread.sleep(2000L);
141142

142143
assertNull(mockServer.queryPubliser(registId));
143144

@@ -151,7 +152,7 @@ public void publishAndRefused() throws InterruptedException {
151152
// step 1
152153
Publisher publisher = registryClient.register(new PublisherRegistration(data), data);
153154

154-
Thread.sleep(500L);
155+
Thread.sleep(2000L);
155156

156157
String registId = publisher.getRegistId();
157158
PublisherRegister publisherRegister = mockServer.queryPubliser(registId);
@@ -182,7 +183,7 @@ public void handleData(String dataId, UserData data) {
182183
Subscriber subscriber = registryClient.register(new SubscriberRegistration(dataId,
183184
dataObserver));
184185

185-
Thread.sleep(500L);
186+
Thread.sleep(2000L);
186187

187188
String registId = subscriber.getRegistId();
188189
SubscriberRegister subscriberRegister = mockServer.querySubscriber(registId);
@@ -191,7 +192,7 @@ public void handleData(String dataId, UserData data) {
191192
// step 2
192193
subscriber.unregister();
193194

194-
Thread.sleep(500L);
195+
Thread.sleep(2000L);
195196

196197
assertNull(mockServer.queryPubliser(registId));
197198

@@ -211,7 +212,7 @@ public void handleData(String dataId, UserData data) {
211212
Subscriber subscriber = registryClient.register(new SubscriberRegistration(
212213
"subscribeAndRefused", dataObserver));
213214

214-
Thread.sleep(500L);
215+
Thread.sleep(2000L);
215216

216217
String registId = subscriber.getRegistId();
217218
SubscriberRegister subscriberRegister = mockServer.querySubscriber(registId);

client/log/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.alipay.sofa</groupId>
77
<artifactId>registry-client-parent</artifactId>
8-
<version>5.3.0-SNAPSHOT</version>
8+
<version>5.3.1-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.alipay.sofa</groupId>
99
<artifactId>registry-parent</artifactId>
10-
<version>5.3.0-SNAPSHOT</version>
10+
<version>5.3.1-SNAPSHOT</version>
1111
<relativePath>../pom.xml</relativePath>
1212
</parent>
1313

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.alipay.sofa</groupId>
77
<artifactId>registry-parent</artifactId>
8-
<version>5.3.0-SNAPSHOT</version>
8+
<version>5.3.1-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

0 commit comments

Comments
 (0)