[incubator-dubbo] branch master updated: Use jacoco instead of cobertura for coverage rate collectiong (#1575)

2018-04-09 Thread wangxin
This is an automated email from the ASF dual-hosted git repository.

wangxin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
 new c25d462  Use jacoco instead of cobertura for coverage rate collectiong 
(#1575)
c25d462 is described below

commit c25d462ff48c725440393da801e8c614df600248
Author: Huang YunKun 
AuthorDate: Tue Apr 10 11:47:50 2018 +0800

Use jacoco instead of cobertura for coverage rate collectiong (#1575)
---
 .travis.yml|  2 +-
 .../alibaba/dubbo/common/utils/ReflectUtils.java   |  3 ++
 pom.xml| 36 ++
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 101cb29..e774ec5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,12 +2,12 @@ language: java
 sudo: false # faster builds
 
 jdk:
+- oraclejdk9
 - oraclejdk8
 - openjdk7
 
 script:
 - travis_wait 30 mvn clean package
-- travis_wait 30 mvn cobertura:cobertura
 
 after_success:
   - bash <(curl -s https://codecov.io/bash)
diff --git 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ReflectUtils.java 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ReflectUtils.java
index 88f4516..f9a8bba 100644
--- 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ReflectUtils.java
+++ 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ReflectUtils.java
@@ -910,6 +910,9 @@ public final class ReflectUtils {
 while (cls != null && cls != Object.class) {
 Field[] fields = cls.getDeclaredFields();
 for (Field field : fields) {
+if (field.isSynthetic()) {
+continue;
+}
 Object property = getEmptyObject(field.getType(), 
emptyInstances, level + 1);
 if (property != null) {
 try {
diff --git a/pom.xml b/pom.xml
index 066f75a..f7bcfff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,10 +111,10 @@
 2.8.2
 3.6.0
 3.0.1
-2.7
 3.0.0
 6.1.26
 3.0.0
+0.8.1
 
 
 
@@ -184,7 +184,6 @@
 2.7
 3.1
 3.0.1
-2.7
 2.10.1
 
 
@@ -338,7 +337,7 @@
 
 true
 once
-${argline}
+${argline} ${jacocoArgLine}
 
 
 
@@ -422,16 +421,27 @@
 
 
 
-org.codehaus.mojo
-cobertura-maven-plugin
-${maven_cobertura_version}
-
-
-html
-xml
-
-
-
+org.jacoco
+jacoco-maven-plugin
+${maven_jacoco_version}
+
+
+jacoco-initialize
+
+prepare-agent
+
+
+jacocoArgLine
+
+
+
+jacoco-site
+package
+
+report
+
+
+
 
 
 

-- 
To stop receiving notification emails like this one, please contact
wang...@apache.org.


[incubator-dubbo] branch master updated: 1. dubbo monitor parameters add group and version (#1407)

2018-04-09 Thread iluo
This is an automated email from the ASF dual-hosted git repository.

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
 new 2e84f07  1. dubbo monitor parameters add group and version (#1407)
2e84f07 is described below

commit 2e84f07203cc1955b1822e0821fa908ea77a20d0
Author: Young Hu 
AuthorDate: Tue Apr 10 10:37:25 2018 +0800

1. dubbo monitor parameters add group and version (#1407)

2. monitor interval can be override by outside setting
---
 .../src/main/java/com/alibaba/dubbo/config/MonitorConfig.java  | 10 ++
 .../dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd  |  5 +
 .../java/com/alibaba/dubbo/monitor/support/MonitorFilter.java  |  6 +-
 .../java/com/alibaba/dubbo/monitor/dubbo/DubboMonitor.java |  5 -
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/MonitorConfig.java
 
b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/MonitorConfig.java
index 9d51517..835daed 100644
--- 
a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/MonitorConfig.java
+++ 
b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/MonitorConfig.java
@@ -41,6 +41,8 @@ public class MonitorConfig extends AbstractConfig {
 
 private String version;
 
+private String interval;
+
 // customized parameters
 private Map parameters;
 
@@ -123,4 +125,12 @@ public class MonitorConfig extends AbstractConfig {
 this.isDefault = isDefault;
 }
 
+public void setInterval(String interval){
+this.interval = interval;
+}
+
+public String getInterval(){
+return interval;
+}
+
 }
\ No newline at end of file
diff --git 
a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd 
b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd
index 1ae252a..e21b1a5 100644
--- a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd
+++ b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd
@@ -574,6 +574,11 @@
 
 
 
+
+
+
+
+
 
 
 
diff --git 
a/dubbo-monitor/dubbo-monitor-api/src/main/java/com/alibaba/dubbo/monitor/support/MonitorFilter.java
 
b/dubbo-monitor/dubbo-monitor-api/src/main/java/com/alibaba/dubbo/monitor/support/MonitorFilter.java
index ebeb4ee..679b25c 100644
--- 
a/dubbo-monitor/dubbo-monitor-api/src/main/java/com/alibaba/dubbo/monitor/support/MonitorFilter.java
+++ 
b/dubbo-monitor/dubbo-monitor-api/src/main/java/com/alibaba/dubbo/monitor/support/MonitorFilter.java
@@ -84,6 +84,8 @@ public class MonitorFilter implements Filter {
 String application = 
invoker.getUrl().getParameter(Constants.APPLICATION_KEY);
 String service = invoker.getInterface().getName(); // service name
 String method = RpcUtils.getMethodName(invocation); // method name
+String group = invoker.getUrl().getParameter(Constants.GROUP_KEY);
+String version = 
invoker.getUrl().getParameter(Constants.VERSION_KEY);
 URL url = invoker.getUrl().getUrlParameter(Constants.MONITOR_KEY);
 Monitor monitor = monitorFactory.getMonitor(url);
 if (monitor == null) {
@@ -121,7 +123,9 @@ public class MonitorFilter implements Filter {
 MonitorService.ELAPSED, String.valueOf(elapsed),
 MonitorService.CONCURRENT, String.valueOf(concurrent),
 Constants.INPUT_KEY, input,
-Constants.OUTPUT_KEY, output));
+Constants.OUTPUT_KEY, output,
+Constants.GROUP_KEY, group,
+Constants.VERSION_KEY, version));
 } catch (Throwable t) {
 logger.error("Failed to monitor count service " + invoker.getUrl() 
+ ", cause: " + t.getMessage(), t);
 }
diff --git 
a/dubbo-monitor/dubbo-monitor-default/src/main/java/com/alibaba/dubbo/monitor/dubbo/DubboMonitor.java
 
b/dubbo-monitor/dubbo-monitor-default/src/main/java/com/alibaba/dubbo/monitor/dubbo/DubboMonitor.java
index 7393afe..b320492 100644
--- 
a/dubbo-monitor/dubbo-monitor-default/src/main/java/com/alibaba/dubbo/monitor/dubbo/DubboMonitor.java
+++ 
b/dubbo-monitor/dubbo-monitor-default/src/main/java/com/alibaba/dubbo/monitor/dubbo/DubboMonitor.java
@@ -16,6 +16,7 @@
  */
 package com.alibaba.dubbo.monitor.dubbo;
 
+import com.alibaba.dubbo.common.Constants;
 import com.alibaba.dubbo.common.URL;
 import com.alibaba.dubbo.common.logger.Logger;
 import com.alibaba.dubbo.common.logger.LoggerFactory;
@@ -92,6 +93,7 @@ public class DubboMonitor implements Monitor {
 long maxOutput = numbers[7];
  

[incubator-dubbo] branch master updated: Extension: Eager Thread Pool (#1568)

2018-04-09 Thread iluo
This is an automated email from the ASF dual-hosted git repository.

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
 new 38f45ee  Extension: Eager Thread Pool (#1568)
38f45ee is described below

commit 38f45eec3ad193a7b35ea0f9dfdce7cb30611705
Author: 时无两丶 <442367...@qq.com>
AuthorDate: Mon Apr 9 22:55:56 2018 +0800

Extension: Eager Thread Pool (#1568)

* Extension: Enhanced Thread Pool
A thread pool that can provide faster processing speeds when there are more 
tasks (of course it consumes more resources)
* When the number of tasks exceeds the core size, a new thread is first 
started to execute the task instead of putting it into the queue.
* When the number of tasks is lower than the core size for a long time, the 
core size threads are maintained and redundant threads are recycled.
* Compared to the fixed pool:When there are more tasks, provide more 
workers to handle the tasks.
* Compared to the cached pool:The task queue in the cached pool is actually 
a SynchronousQueue and does not have the ability to cache tasks.
* Whether to fail fail or put into a queue when a thread runs out:Both are 
feasible and need to consider which way should be applied according to the 
business scenario. Delayed scenarios are not allowed. Failfast is more 
reasonable than queues. However, if there is a certain tolerance for delays, 
queues are more reasonable than failfast.

* remove * in import

* add license to fix ci failure

* rename the thread pool to EagerThreadPool
modify sth with the code review
format the code file

* remove '*' in import statement

* throw NullPointerException if the param is null.

* throw NullPointerException if the param is null.

* catch throwable and decrease submitted task count anyway
---
 .../threadpool/support/eager/EagerThreadPool.java  | 56 +
 .../support/eager/EagerThreadPoolExecutor.java | 84 +++
 .../common/threadpool/support/eager/TaskQueue.java | 79 ++
 .../com.alibaba.dubbo.common.threadpool.ThreadPool |  1 +
 .../support/eager/EagerThreadPoolExecutorTest.java | 93 ++
 .../dubbo/common/utils/ConfigUtilsTest.java|  1 +
 6 files changed, 314 insertions(+)

diff --git 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/threadpool/support/eager/EagerThreadPool.java
 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/threadpool/support/eager/EagerThreadPool.java
new file mode 100644
index 000..eb4e1f3
--- /dev/null
+++ 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/threadpool/support/eager/EagerThreadPool.java
@@ -0,0 +1,56 @@
+/*
+ * 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 com.alibaba.dubbo.common.threadpool.support.eager;
+
+import com.alibaba.dubbo.common.Constants;
+import com.alibaba.dubbo.common.URL;
+import com.alibaba.dubbo.common.threadpool.ThreadPool;
+import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport;
+import com.alibaba.dubbo.common.utils.NamedThreadFactory;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * EagerThreadPool
+ * When the core threads are all in busy,
+ * create new thread instead of putting task into blocking queue.
+ */
+public class EagerThreadPool implements ThreadPool {
+
+@Override
+public Executor getExecutor(URL url) {
+String name = url.getParameter(Constants.THREAD_NAME_KEY, 
Constants.DEFAULT_THREAD_NAME);
+int cores = url.getParameter(Constants.CORE_THREADS_KEY, 
Constants.DEFAULT_CORE_THREADS);
+int threads = url.getParameter(Constants.THREADS_KEY, 
Integer.MAX_VALUE);
+int queues = url.getParameter(Constants.QUEUES_KEY, 
Constants.DEFAULT_QUEUES);
+int alive = url.getParameter(Constants.ALIVE_KEY, 
Constants.DEFAULT_ALIVE);
+
+// init queue and executor
+TaskQueue taskQueue = new TaskQueue(queues <= 0 ? 
1 : queues);
+EagerThreadPoolExecutor executor = new EagerThreadPoolExecutor(cores,
+threads,
+ 

[incubator-dubbo] branch master updated: remove the method with the same function but the different name in NetUtils (#1572)

2018-04-09 Thread iluo
This is an automated email from the ASF dual-hosted git repository.

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
 new 9f48d8d  remove the method with the same function but the different 
name in NetUtils (#1572)
9f48d8d is described below

commit 9f48d8dbdd06e60faf84809a19a8c4e47733c38d
Author: 时无两丶 <442367...@qq.com>
AuthorDate: Mon Apr 9 19:33:32 2018 +0800

remove the method with the same function but the different name in NetUtils 
(#1572)
---
 .../java/com/alibaba/dubbo/common/logger/support/FailsafeLogger.java | 2 +-
 .../src/main/java/com/alibaba/dubbo/common/utils/NetUtils.java   | 5 -
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/logger/support/FailsafeLogger.java
 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/logger/support/FailsafeLogger.java
index 858a4e0..b964693 100644
--- 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/logger/support/FailsafeLogger.java
+++ 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/logger/support/FailsafeLogger.java
@@ -37,7 +37,7 @@ public class FailsafeLogger implements Logger {
 }
 
 private String appendContextMessage(String msg) {
-return " [DUBBO] " + msg + ", dubbo version: " + Version.getVersion() 
+ ", current host: " + NetUtils.getLogHost();
+return " [DUBBO] " + msg + ", dubbo version: " + Version.getVersion() 
+ ", current host: " + NetUtils.getLocalHost();
 }
 
 public void trace(String msg, Throwable e) {
diff --git 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/NetUtils.java 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/NetUtils.java
index 5295831..ee79de4 100644
--- a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/NetUtils.java
+++ b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/NetUtils.java
@@ -182,11 +182,6 @@ public class NetUtils {
 return localAddress;
 }
 
-public static String getLogHost() {
-InetAddress address = getLocalAddress();
-return address == null ? LOCALHOST : address.getHostAddress();
-}
-
 private static InetAddress getLocalAddress0() {
 InetAddress localAddress = null;
 try {

-- 
To stop receiving notification emails like this one, please contact
i...@apache.org.