Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Apr 23, 2018
2 parents a7d176f + a2a7706 commit 4d6b1fa
Show file tree
Hide file tree
Showing 569 changed files with 3,174 additions and 711 deletions.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- "dubbo-demo/.*"
10 changes: 5 additions & 5 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ XXXXX

## Brief changelog

XX
XXXXX

## Verifying this change

XXXX
XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

- [x] Make sure there is a [GITHUB_issue](https://github.com/alibaba/dubbo/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Format the pull request title like `[Dubbo-XXX] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
- [x] Make sure there is a [GITHUB_issue](https://github.com/apache/incubator-dubbo/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Format the pull request title like `[Dubbo-XXX] Fix UnknownException when host config not exist #XXX`. Each commit in the pull request should have a meaningful subject line and body.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/alibaba/dubbo/tree/master/dubbo-test).
- [ ] Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test` to make sure integration-test pass.
- [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/incubator-dubbo/wiki/Software-donation-guide).
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
![license](https://img.shields.io/github/license/alibaba/dubbo.svg)
![maven](https://img.shields.io/maven-central/v/com.alibaba/dubbo.svg)

Apache Dubbo (incubating) is a high-performance, java based RPC framework open-sourced by Alibaba. Please visit [dubbo official site ](http://dubbo.incubator.apache.org) for quick start and other information.

Apache Dubbo (incubating) is a high-performance, java based RPC framework open-sourced by Alibaba. Please visit [dubbo official site ](http://dubbo.incubator.apache.org) for quick start and documentations, as well as [Wiki](https://github.com/apache/incubator-dubbo/wiki) for news, FAQ, and release notes.

We are now collecting dubbo user info in order to help us to improve dubbo better, pls. kindly help us by providing yours on [issue#1012: Wanted: who's using dubbo](https://github.com/apache/incubator-dubbo/issues/1012), thanks :)

Expand Down
16 changes: 0 additions & 16 deletions codestyle/checkstyle-header.txt

This file was deleted.

5 changes: 0 additions & 5 deletions codestyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java"/>
<!-- Root Checks -->
<module name="com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck">
<property name="headerFile" value="${checkstyle.header.file}" />
<property name="fileExtensions" value="java" />
</module>

<!-- TreeWalker Checks -->
<module name="TreeWalker">
Expand Down
7 changes: 7 additions & 0 deletions dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<log4j_version>1.2.16</log4j_version>
<logback_version>1.2.2</logback_version>
<commons_lang3_version>3.4</commons_lang3_version>
<embedded_redis_version>0.6</embedded_redis_version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -327,6 +328,12 @@
<version>${curator_version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.kstyrc</groupId>
<artifactId>embedded-redis</artifactId>
<version>${embedded_redis_version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ public static void main(String[] args) {
System.out.println(URL.encode("timeout=100"));
}

@Override
public URL getUrl() {
return configuratorUrl;
}

@Override
public URL configure(URL url) {
if (configuratorUrl == null || configuratorUrl.getHost() == null
|| url == null || url.getHost() == null) {
Expand Down Expand Up @@ -107,6 +109,7 @@ private URL configureIfMatch(String host, URL url) {
* @param o
* @return
*/
@Override
public int compareTo(Configurator o) {
if (o == null) {
return -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public AbsentConfigurator(URL url) {
super(url);
}

@Override
public URL doConfigure(URL currentUrl, URL configUrl) {
return currentUrl.addParametersIfAbsent(configUrl.getParameters());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
public class AbsentConfiguratorFactory implements ConfiguratorFactory {

@Override
public Configurator getConfigurator(URL url) {
return new AbsentConfigurator(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public OverrideConfigurator(URL url) {
super(url);
}

@Override
public URL doConfigure(URL currentUrl, URL configUrl) {
return currentUrl.addParameters(configUrl.getParameters());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
public class OverrideConfiguratorFactory implements ConfiguratorFactory {

@Override
public Configurator getConfigurator(URL url) {
return new OverrideConfigurator(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public AbstractDirectory(URL url, URL consumerUrl, List<Router> routers) {
setRouters(routers);
}

@Override
public List<Invoker<T>> list(Invocation invocation) throws RpcException {
if (destroyed) {
throw new RpcException("Directory already destroyed .url: " + getUrl());
Expand All @@ -86,6 +87,7 @@ public List<Invoker<T>> list(Invocation invocation) throws RpcException {
return invokers;
}

@Override
public URL getUrl() {
return url;
}
Expand Down Expand Up @@ -121,10 +123,11 @@ public boolean isDestroyed() {
return destroyed;
}

@Override
public void destroy() {
destroyed = true;
}

protected abstract List<Invoker<T>> doList(Invocation invocation) throws RpcException;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ public StaticDirectory(URL url, List<Invoker<T>> invokers, List<Router> routers)
this.invokers = invokers;
}

@Override
public Class<T> getInterface() {
return invokers.get(0).getInterface();
}

@Override
public boolean isAvailable() {
if (isDestroyed()) {
return false;
Expand All @@ -67,6 +69,7 @@ public boolean isAvailable() {
return false;
}

@Override
public void destroy() {
if (isDestroyed()) {
return;
Expand All @@ -84,4 +87,4 @@ protected List<Invoker<T>> doList(Invocation invocation) throws RpcException {
return invokers;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static int calculateWarmupWeight(int uptime, int warmup, int weight) {
return ww < 1 ? 1 : (ww > weight ? weight : ww);
}

@Override
public <T> Invoker<T> select(List<Invoker<T>> invokers, URL url, Invocation invocation) {
if (invokers == null || invokers.isEmpty())
return null;
Expand All @@ -60,4 +61,4 @@ protected int getWeight(Invoker<?> invoker, Invocation invocation) {
return weight;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class LeastActiveLoadBalance extends AbstractLoadBalance {

private final Random random = new Random();

@Override
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) {
int length = invokers.size(); // Number of invokers
int leastActive = -1; // The least active value of all invokers
Expand Down Expand Up @@ -83,4 +84,4 @@ protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation
// If all invokers have the same weight value or totalWeight=0, return evenly.
return invokers.get(leastIndexs[random.nextInt(leastCount)]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class RandomLoadBalance extends AbstractLoadBalance {

private final Random random = new Random();

@Override
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) {
int length = invokers.size(); // Number of invokers
int totalWeight = 0; // The sum of weights
Expand Down Expand Up @@ -60,4 +61,4 @@ protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation
return invokers.get(random.nextInt(length));
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class RoundRobinLoadBalance extends AbstractLoadBalance {

private final ConcurrentMap<String, AtomicPositiveInteger> sequences = new ConcurrentHashMap<String, AtomicPositiveInteger>();

@Override
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) {
String key = invokers.get(0).getUrl().getServiceKey() + "." + invocation.getMethodName();
int length = invokers.size(); // Number of invokers
Expand Down Expand Up @@ -99,4 +100,4 @@ public void decrement() {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class ArrayMerger implements Merger<Object[]> {

public static final ArrayMerger INSTANCE = new ArrayMerger();

@Override
public Object[] merge(Object[]... others) {
if (others.length == 0) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class BooleanArrayMerger implements Merger<boolean[]> {

@Override
public boolean[] merge(boolean[]... items) {
int totalLen = 0;
for (boolean[] array : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class ByteArrayMerger implements Merger<byte[]> {

@Override
public byte[] merge(byte[]... items) {
int total = 0;
for (byte[] array : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class CharArrayMerger implements Merger<char[]> {

@Override
public char[] merge(char[]... items) {
int total = 0;
for (char[] array : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class DoubleArrayMerger implements Merger<double[]> {

@Override
public double[] merge(double[]... items) {
int total = 0;
for (double[] array : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class FloatArrayMerger implements Merger<float[]> {

@Override
public float[] merge(float[]... items) {
int total = 0;
for (float[] array : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class IntArrayMerger implements Merger<int[]> {

@Override
public int[] merge(int[]... items) {
int totalLen = 0;
for (int[] item : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

public class ListMerger implements Merger<List<?>> {

@Override
public List<Object> merge(List<?>... items) {
List<Object> result = new ArrayList<Object>();
for (List<?> item : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class LongArrayMerger implements Merger<long[]> {

@Override
public long[] merge(long[]... items) {
int total = 0;
for (long[] array : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

public class MapMerger implements Merger<Map<?, ?>> {

@Override
public Map<?, ?> merge(Map<?, ?>... items) {
if (items.length == 0) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

public class SetMerger implements Merger<Set<?>> {

@Override
public Set<Object> merge(Set<?>... items) {

Set<Object> result = new HashSet<Object>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class ShortArrayMerger implements Merger<short[]> {

@Override
public short[] merge(short[]... items) {
int total = 0;
for (short[] array : items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*/
public class MockInvokersSelector implements Router {

@Override
public <T> List<Invoker<T>> route(final List<Invoker<T>> invokers,
URL url, final Invocation invocation) throws RpcException {
if (invocation.getAttachments() == null) {
Expand Down Expand Up @@ -86,10 +87,12 @@ private <T> boolean hasMockProviders(final List<Invoker<T>> invokers) {
return hasMockProvider;
}

@Override
public URL getUrl() {
return null;
}

@Override
public int compareTo(Router o) {
return 1;
}
Expand Down
Loading

0 comments on commit 4d6b1fa

Please sign in to comment.