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

Dubbo Cloud Native #4764

Merged
merged 32 commits into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f51b394
Polish apache/dubbo#4542 : [Enhancement] Adapt the Java standard Even…
mercyblitz Jul 11, 2019
9e58caa
Polish apache/dubbo#4541 : [Feature] Add local File System DynamicCon…
mercyblitz Jul 15, 2019
9252be1
Polish apache#4541 : Bugfix
mercyblitz Jul 15, 2019
08089b6
Polish apache/dubbo#4541 : Optimization
mercyblitz Jul 15, 2019
cdd9338
Polish apache/dubbo#4541 : Add the compatibility for PollingWatchServ…
mercyblitz Jul 16, 2019
f0408f7
Polish apache/dubbo#4541 : Add delay publish without ThreadPoolExecutor
mercyblitz Jul 16, 2019
5f354a0
Polish apache/dubbo#4541 : Refactor the extension name
mercyblitz Jul 17, 2019
8152a75
Polish apache/dubbo#4541 : Add remove ops
mercyblitz Jul 17, 2019
df1a258
Polish apache/dubbo#4541 : Add testable constructor
mercyblitz Jul 17, 2019
52c0205
Polish apache/dubbo#4541 : Add getConfigGroups method
mercyblitz Jul 17, 2019
293a70d
Polish apache/dubbo#4610 : [Refactor] Refactor the bootstrap module
mercyblitz Jul 20, 2019
3218a1f
Polish apache/dubbo#4541 : Fix the nulling URL issue
mercyblitz Jul 20, 2019
d5c78ac
Polish apache/dubbo#4622 : [Refactor] Refactor ConfigManager
mercyblitz Jul 25, 2019
1d54a1d
Polish apache/dubbo#4622 : [Refactor] Refactor ConfigManager
mercyblitz Jul 25, 2019
5071a04
Polish apache/dubbo#4622 : Support multiple configcenters
mercyblitz Jul 26, 2019
ccf614c
Polish apache/dubbo#4671 : ServiceNameMapping will not map the group,…
mercyblitz Jul 26, 2019
87e88e2
update referenceCount log (#4683)
haiyang1985 Jul 29, 2019
5d299af
Polish /apache/dubbo#4687 : Remove the duplicated test code in dubbo-…
mercyblitz Jul 29, 2019
25ec31e
#4685 修改代码if判断false问题 if (hasException == false)修改成if (!hasException…
smipo Jul 30, 2019
c3132b8
Fixed Service annotation method parameters are not in effect (#4598)
Leishunyu Jul 31, 2019
f490df8
keep demo simple, and switch to use zookeeper as registry center (#4705)
beiwei30 Jul 31, 2019
c8dbd7d
@Reference auto-wires the instance of generic interface #4594 (#4677)
CodingSinger Jul 31, 2019
65a0140
try to shorten maven output to make travis build pass (#4710)
beiwei30 Aug 1, 2019
5b38331
use CountDownLatch to check zk registry if establish connection (#4589)
tswstarplanet Aug 1, 2019
a646874
Minor change
mercyblitz Aug 1, 2019
b8e601a
Merge remote-tracking branch 'upstream/master' into dubbo-cloud-native
mercyblitz Aug 2, 2019
0644fe1
Rename the extension name of WritableMetadataService
mercyblitz Aug 5, 2019
9f405d7
Polish apache/dubbo#4759 : [Refactor] Change the signature of methods…
mercyblitz Aug 7, 2019
a344121
Merge remote-tracking branch 'upstream/master' into dubbo-cloud-native
mercyblitz Aug 7, 2019
8c7f37a
Polish apache/dubbo#3984 : Add the implementation of Page<ServiceInst…
mercyblitz Aug 7, 2019
2a88323
Code merge
mercyblitz Aug 7, 2019
240c456
Code merge
mercyblitz Aug 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cache:
install: true

script:
- travis_wait 30 ./mvnw clean install -DskipTests=false -Dcheckstyle.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true
- travis_wait 30 ./mvnw --quiet clean install -DskipTests=false -Dcheckstyle.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true

after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
1 change: 1 addition & 0 deletions dubbo-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dubbo-bom</artifactId>
Expand Down
40 changes: 3 additions & 37 deletions dubbo-bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@

<!-- Test dependencies -->


<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-configcenter-zookeeper</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<!-- Zookeeper dependencies for testing -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-zookeeper</artifactId>
Expand All @@ -48,29 +41,13 @@
<scope>test</scope>
</dependency>

<!-- Zookeeper dependencies for testing -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-etcd3</artifactId>
<version>${project.parent.version}</version>
<!-- <scope>test</scope>-->
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-metadata-report-etcd</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-configcenter-etcd</artifactId>
<artifactId>dubbo-configcenter-zookeeper</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>


<!-- Nacos dependencies for testing -->
<dependency>
<groupId>org.apache.dubbo</groupId>
Expand Down Expand Up @@ -113,17 +90,6 @@
<scope>test</scope>
</dependency>

<!-- <dependency>-->
<!-- <groupId>com.google.guava</groupId>-->
<!-- <artifactId>guava</artifactId>-->
<!-- <version>20.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand All @@ -77,7 +76,6 @@
import static org.apache.dubbo.common.utils.StringUtils.isNotEmpty;
import static org.apache.dubbo.config.context.ConfigManager.getInstance;
import static org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistries;
import static org.apache.dubbo.remoting.Constants.CLIENT_KEY;

/**
* The bootstrap class of Dubbo
Expand Down Expand Up @@ -114,19 +112,14 @@ public class DubboBootstrap {

private final ConfigManager configManager = getInstance();

/**
* Is provider or not
*/
private boolean isProvider;

private boolean initialized = false;
private volatile boolean initialized = false;

private boolean started = false;
private volatile boolean started = false;

/**
* Only Provider Register
*/
private boolean onlyRegisterProvider = false;
private volatile boolean onlyRegisterProvider = false;

private ServiceInstance serviceInstance;

Expand Down Expand Up @@ -155,6 +148,7 @@ public DubboBootstrap metadataReport(List<MetadataReportConfig> metadataReportCo
return this;
}


// {@link ApplicationConfig} correlative methods

/**
Expand Down Expand Up @@ -193,6 +187,7 @@ public DubboBootstrap application(ApplicationConfig applicationConfig) {
return this;
}


// {@link RegistryConfig} correlative methods

/**
Expand Down Expand Up @@ -240,8 +235,8 @@ public DubboBootstrap registries(Iterable<RegistryConfig> registryConfigs) {
return this;
}

// {@link ProtocolConfig} correlative methods

// {@link ProtocolConfig} correlative methods
public DubboBootstrap protocol(Consumer<ProtocolBuilder> consumerBuilder) {
return protocol(DEFAULT_PROTOCOL_ID, consumerBuilder);
}
Expand All @@ -261,8 +256,8 @@ public DubboBootstrap protocols(List<ProtocolConfig> protocolConfigs) {
return this;
}

// {@link ServiceConfig} correlative methods

// {@link ServiceConfig} correlative methods
public <S> DubboBootstrap service(Consumer<ServiceBuilder<S>> consumerBuilder) {
return service(DEFAULT_SERVICE_ID, consumerBuilder);
}
Expand All @@ -278,8 +273,8 @@ public DubboBootstrap service(ServiceConfig<?> serviceConfig) {
return this;
}

// {@link Reference} correlative methods

// {@link Reference} correlative methods
public <S> DubboBootstrap reference(Consumer<ReferenceBuilder<S>> consumerBuilder) {
return reference(DEFAULT_REFERENCE_ID, consumerBuilder);
}
Expand All @@ -295,8 +290,8 @@ public DubboBootstrap reference(ReferenceConfig<?> referenceConfig) {
return this;
}

// {@link ProviderConfig} correlative methods

// {@link ProviderConfig} correlative methods
public DubboBootstrap provider(Consumer<ProviderBuilder> builderConsumer) {
return provider(DEFAULT_PROVIDER_ID, builderConsumer);
}
Expand All @@ -316,8 +311,8 @@ public DubboBootstrap providers(List<ProviderConfig> providerConfigs) {
return this;
}

// {@link ConsumerConfig} correlative methods

// {@link ConsumerConfig} correlative methods
public DubboBootstrap consumer(Consumer<ConsumerBuilder> builderConsumer) {
return consumer(DEFAULT_CONSUMER_ID, builderConsumer);
}
Expand All @@ -338,6 +333,7 @@ public DubboBootstrap consumers(List<ConsumerConfig> consumerConfigs) {
}

// {@link ConfigCenterConfig} correlative methods

public DubboBootstrap configCenter(ConfigCenterConfig configCenterConfig) {
return configCenter(asList(configCenterConfig));
}
Expand Down Expand Up @@ -424,13 +420,8 @@ private void useRegistryAsConfigCenterIfNecessary() {
String id = "config-center-" + protocol + "-" + registryConfig.getPort();
ConfigCenterConfig cc = new ConfigCenterConfig();
cc.setId(id);
cc.setParameters(registryConfig.getParameters() == null ?
new HashMap<>() :
new HashMap<>(registryConfig.getParameters()));
cc.getParameters().put(CLIENT_KEY,registryConfig.getClient());
cc.setProtocol(registryConfig.getProtocol());
cc.setProtocol(protocol);
cc.setAddress(registryConfig.getAddress());
cc.setNamespace(registryConfig.getGroup());
cc.setHighestPriority(false);
configManager.addConfigCenter(cc);
});
Expand Down Expand Up @@ -463,7 +454,6 @@ public DubboBootstrap start() {
/**
* export {@link MetadataService}
*/
// TODO, only export to default registry?
List<URL> exportedURLs = exportMetadataService(
configManager.getApplication().orElseThrow(() -> new IllegalStateException("ApplicationConfig cannot be null")),
configManager.getRegistries(),
Expand Down Expand Up @@ -541,6 +531,7 @@ public boolean isStarted() {


/* serve for builder apis, begin */

private ApplicationBuilder createApplicationBuilder(String name) {
return new ApplicationBuilder().name(name);
}
Expand Down Expand Up @@ -569,8 +560,8 @@ private ConsumerBuilder createConsumerBuilder(String id) {
return new ConsumerBuilder().id(id);
}

/* serve for builder apis, end */

/* serve for builder apis, end */
private void startMetadataReport() {
ApplicationConfig applicationConfig = configManager.getApplication().orElseThrow(() -> new IllegalStateException("There's no ApplicationConfig specified."));

Expand Down Expand Up @@ -612,15 +603,14 @@ private DynamicConfiguration prepareEnvironment(ConfigCenterConfig configCenter)
return null;
}
DynamicConfiguration dynamicConfiguration = getDynamicConfiguration(configCenter.toUrl());
String configContent = dynamicConfiguration.getProperties(configCenter.getConfigFile(), configCenter.getGroup());
String configContent = dynamicConfiguration.getRule(configCenter.getConfigFile(), configCenter.getGroup());

String appGroup = configManager.getApplication().orElse(new ApplicationConfig()).getName();
String appConfigContent = null;
if (isNotEmpty(appGroup)) {
appConfigContent = dynamicConfiguration.getProperties
(isNotEmpty(configCenter.getAppConfigFile()) ? configCenter.getAppConfigFile() : configCenter.getConfigFile(),
appGroup
);
appConfigContent = dynamicConfiguration.getConfig(isNotEmpty(configCenter.getAppConfigFile()) ?
configCenter.getAppConfigFile() : configCenter.getConfigFile(), appGroup
);
}
try {
Environment.getInstance().setConfigCenterFirst(configCenter.isHighestPriority());
Expand Down Expand Up @@ -663,6 +653,10 @@ public void exportServiceConfig(ServiceConfig<?> serviceConfig) {
serviceConfig.export();
}

public boolean isOnlyRegisterProvider() {
return onlyRegisterProvider;
}

private void registerServiceInstance(List<URL> exportedURLs) {

exportedURLs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.context.ConfigManager;


/**
* Dubbo Provider Bootstrap
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public static void main(String[] args) {
.registry("zookeeper", builder -> builder.address("zookeeper://127.0.0.1:2181?registry-type=service"))
// Nacos
.registry("nacos", builder -> builder.address("nacos://127.0.0.1:8848?registry-type=service"))
// .registry(RegistryBuilder.newBuilder().address("etcd3://127.0.0.1:2379?registry-type=service").build())
.protocol(builder -> builder.port(-1).name("dubbo"))
.service(builder -> builder.id("test").interfaceClass(EchoService.class).ref(new EchoServiceImpl()))
.start()
Expand Down
1 change: 1 addition & 0 deletions dubbo-cluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>dubbo-cluster</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private synchronized void init(String ruleKey) {
}
String routerKey = ruleKey + RULE_SUFFIX;
configuration.addListener(routerKey, this);
String rule = configuration.getRule(routerKey, DynamicConfiguration.DEFAULT_GROUP);
String rule = configuration.getConfig(routerKey, DynamicConfiguration.DEFAULT_GROUP);
if (StringUtils.isNotEmpty(rule)) {
this.process(new ConfigChangeEvent(routerKey, rule));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public <T> void notify(List<Invoker<T>> invokers) {
String key = providerApplication + RULE_SUFFIX;
configuration.addListener(key, this);
application = providerApplication;
String rawRule = configuration.getRule(key, DynamicConfiguration.DEFAULT_GROUP);
String rawRule = configuration.getConfig(key, DynamicConfiguration.DEFAULT_GROUP);
if (StringUtils.isNotEmpty(rawRule)) {
this.process(new ConfigChangeEvent(key, rawRule));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

import java.util.List;

import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
import static org.apache.dubbo.rpc.Constants.MOCK_KEY;
import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;

public class MockClusterInvoker<T> implements Invoker<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
*/
package org.apache.dubbo.rpc.cluster.router;

import org.apache.dubbo.rpc.cluster.router.tag.model.TagRouterRule;
import org.apache.dubbo.rpc.cluster.router.tag.model.TagRuleParser;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.dubbo.rpc.cluster.router.tag.model.TagRouterRule;
import org.apache.dubbo.rpc.cluster.router.tag.model.TagRuleParser;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_AVAILABLE_CHECK_KEY;
import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
import static org.apache.dubbo.rpc.cluster.Constants.REFER_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;

Expand Down
1 change: 1 addition & 0 deletions dubbo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-parent</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>dubbo-common</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,4 @@ default <T> T convert(Class<T> cls, String key, T defaultValue) {

return cls.cast(obj);
}


}
Loading