You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2020/03/10 01:59:19 UTC

[dubbo] branch 2.7.6-release updated (88e5206 -> e0ff2ef)

This is an automated email from the ASF dual-hosted git repository.

liujun pushed a change to branch 2.7.6-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git.


    from 88e5206  fix #5837 (#5839)
     new a972650  extracting duplicate code in CountTelnetHandler (#5824)
     new a573806  Add test cases for NacosMetadataReport (#5776)
     new 5f8a531  [CI] add source and javadoc jar to snapshot
     new b7730b3  [CI] fix source jar upload issue for snapshot
     new 9e2bb2d  set EXTENSION_LOADERS/EXTENSION_INSTANCE default size to 64 (#5812)
     new ab5cf3d  fix wrong telnet command package(#5690) (#5815)
     new e0ff2ef  fix typo (#5834)

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Jenkinsfile                                        |   4 +-
 .../dubbo/common/extension/ExtensionLoader.java    |   4 +-
 .../store/nacos/NacosMetadataReportTest.java       | 158 +++++++++++++++++++--
 .../dubbo/qos/legacy/CountTelnetHandler.java       |  28 ++--
 .../org.apache.dubbo.remoting.telnet.TelnetHandler |  18 +--
 .../dubbo/remoting/etcd/jetcd/JEtcdClient.java     |   2 +-
 6 files changed, 169 insertions(+), 45 deletions(-)


[dubbo] 02/07: Add test cases for NacosMetadataReport (#5776)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 2.7.6-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit a5738065a9529ad4acaaee5832b8f82a67b32fe7
Author: Lei Jiang <53...@users.noreply.github.com>
AuthorDate: Fri Mar 6 15:35:07 2020 +0800

    Add test cases for NacosMetadataReport (#5776)
    
    * Add more test case for NacosMetadataReport
    
    * Modify codes
    
    * Modify comments
    
    * Add more test case and modify codes
    
    * Modify codes
---
 .../store/nacos/NacosMetadataReportTest.java       | 158 +++++++++++++++++++--
 1 file changed, 143 insertions(+), 15 deletions(-)

diff --git a/dubbo-metadata/dubbo-metadata-report-nacos/src/test/java/org/apache/dubbo/metadata/store/nacos/NacosMetadataReportTest.java b/dubbo-metadata/dubbo-metadata-report-nacos/src/test/java/org/apache/dubbo/metadata/store/nacos/NacosMetadataReportTest.java
index c441635..88fc75a 100644
--- a/dubbo-metadata/dubbo-metadata-report-nacos/src/test/java/org/apache/dubbo/metadata/store/nacos/NacosMetadataReportTest.java
+++ b/dubbo-metadata/dubbo-metadata-report-nacos/src/test/java/org/apache/dubbo/metadata/store/nacos/NacosMetadataReportTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.dubbo.metadata.store.nacos;
 
+import com.alibaba.nacos.api.exception.NacosException;
 import org.apache.dubbo.common.URL;
 import org.apache.dubbo.common.utils.NetUtils;
 import org.apache.dubbo.metadata.definition.ServiceDefinitionBuilder;
@@ -25,13 +26,17 @@ import org.apache.dubbo.metadata.report.identifier.MetadataIdentifier;
 
 import com.alibaba.nacos.api.config.ConfigService;
 import com.google.gson.Gson;
+import org.apache.dubbo.metadata.report.identifier.ServiceMetadataIdentifier;
+import org.apache.dubbo.metadata.report.identifier.SubscriberMetadataIdentifier;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER_SIDE;
@@ -40,19 +45,63 @@ import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER_SIDE;
 //FIXME: waiting for embedded Nacos suport, then we can open the switch.
 @Disabled("https://github.com/alibaba/nacos/issues/1188")
 public class NacosMetadataReportTest {
+
     private static final String SESSION_TIMEOUT_KEY = "session";
+
     private static final String TEST_SERVICE = "org.apache.dubbo.metadata.store.nacos.NacosMetadata4TstService";
+
     private NacosMetadataReport nacosMetadataReport;
+
     private NacosMetadataReportFactory nacosMetadataReportFactory;
+
     private ConfigService configService;
 
-    private static final String NACOS_GROUP = "zzz";
+    private static final String NACOS_GROUP = "metadata_test";
+
+    /**
+     * timeout(ms) for nacos session
+     */
+    private static final int SESSION_TIMEOUT = 15 * 1000;
+
+    /**
+     * timeout(ms) for query operation on nacos
+     */
+    private static final int NACOS_READ_TIMEOUT = 5 * 1000;
+
+    /**
+     * interval(ms) to make nacos cache refresh
+     */
+    private static final int INTERVAL_TO_MAKE_NACOS_REFRESH = 1000;
+
+    /**
+     * version for test
+     */
+    private static final String VERSION = "1.0.0";
+
+    /**
+     * group for test
+     */
+    private static final String METADATA_GROUP = null;
+
+    /**
+     * application name for test
+     */
+    private static final String APPLICATION_NAME = "nacos-metdata-report-test";
+
+    /**
+     * revision for test
+     */
+    private static final String REVISION = "90980";
+
+    /**
+     * protocol for test
+     */
+    private static final String PROTOCOL = "xxx";
 
     @BeforeEach
     public void setUp() {
-        // timeout in 15 seconds.
         URL url = URL.valueOf("nacos://127.0.0.1:8848?group=" + NACOS_GROUP)
-                .addParameter(SESSION_TIMEOUT_KEY, 15000);
+                .addParameter(SESSION_TIMEOUT_KEY, SESSION_TIMEOUT);
         nacosMetadataReportFactory = new NacosMetadataReportFactory();
         this.nacosMetadataReport = (NacosMetadataReport) nacosMetadataReportFactory.createMetadataReport(url);
         this.configService = nacosMetadataReport.buildConfigService(url);
@@ -62,31 +111,109 @@ public class NacosMetadataReportTest {
     public void tearDown() throws Exception {
     }
 
+
     @Test
     public void testStoreProvider() throws Exception {
-        String version = "1.0.0";
-        String group = null;
-        String application = "nacos-metdata-report-test";
         MetadataIdentifier providerIdentifier =
-                storeProvider(nacosMetadataReport, TEST_SERVICE, version, group, application);
-        String serverContent = configService.getConfig(providerIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP, 5000L);
+                storeProvider(nacosMetadataReport, TEST_SERVICE, VERSION, METADATA_GROUP, APPLICATION_NAME);
+        String serverContent = configService.getConfig(providerIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP, NACOS_READ_TIMEOUT);
         Assertions.assertNotNull(serverContent);
 
         Gson gson = new Gson();
         FullServiceDefinition fullServiceDefinition = gson.fromJson(serverContent, FullServiceDefinition.class);
         Assertions.assertEquals(fullServiceDefinition.getParameters().get("paramTest"), "nacosTest");
+
+        //Clear test data
+        configService.removeConfig(providerIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP);
     }
 
     @Test
     public void testStoreConsumer() throws Exception {
-        String version = "1.0.0";
-        String group = null;
-        String application = "nacos-metadata-report-consumer-test";
-        MetadataIdentifier consumerIdentifier = storeConsumer(nacosMetadataReport, TEST_SERVICE, version, group, application);
+        MetadataIdentifier consumerIdentifier = storeConsumer(nacosMetadataReport, TEST_SERVICE, VERSION, METADATA_GROUP, APPLICATION_NAME);
 
-        String serverContent = configService.getConfig(consumerIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP, 5000L);
+        String serverContent = configService.getConfig(consumerIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP, NACOS_READ_TIMEOUT);
         Assertions.assertNotNull(serverContent);
         Assertions.assertEquals(serverContent, "{\"paramConsumerTest\":\"nacosConsumer\"}");
+
+        //clear test data
+        configService.removeConfig(consumerIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP);
+    }
+
+    @Test
+    public void testDoSaveServiceMetadata() throws Exception {
+        URL url = URL.valueOf("xxx://" + NetUtils.getLocalAddress().getHostName() + ":4444/" + TEST_SERVICE +
+                "?paramTest=nacosTest&version=" + VERSION + "&application="
+                + APPLICATION_NAME + (METADATA_GROUP == null ? "" : "&group=" + METADATA_GROUP));
+        ServiceMetadataIdentifier serviceMetadataIdentifier = new ServiceMetadataIdentifier(TEST_SERVICE, VERSION,
+                METADATA_GROUP, "provider", REVISION, PROTOCOL);
+        nacosMetadataReport.doSaveMetadata(serviceMetadataIdentifier, url);
+        Thread.sleep(INTERVAL_TO_MAKE_NACOS_REFRESH);
+        String serviceMetaData = configService.getConfig(serviceMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP, NACOS_READ_TIMEOUT);
+        Assertions.assertNotNull(serviceMetaData);
+        Assertions.assertEquals(serviceMetaData, URL.encode(url.toFullString()));
+
+        //clear test data
+        configService.removeConfig(serviceMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP);
+    }
+
+    @Test
+    public void testDoRemoveServiceMetadata() throws Exception {
+        URL url = URL.valueOf("xxx://" + NetUtils.getLocalAddress().getHostName() + ":4444/" + TEST_SERVICE +
+                "?paramTest=nacosTest&version=" + VERSION + "&application="
+                + APPLICATION_NAME + (METADATA_GROUP == null ? "" : "&group=" + METADATA_GROUP));
+        ServiceMetadataIdentifier serviceMetadataIdentifier = new ServiceMetadataIdentifier(TEST_SERVICE, VERSION,
+                METADATA_GROUP, "provider", REVISION, PROTOCOL);
+        nacosMetadataReport.doSaveMetadata(serviceMetadataIdentifier, url);
+        Thread.sleep(INTERVAL_TO_MAKE_NACOS_REFRESH);
+        String serviceMetaData = configService.getConfig(serviceMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP, NACOS_READ_TIMEOUT);
+        Assertions.assertNotNull(serviceMetaData);
+
+        nacosMetadataReport.doRemoveMetadata(serviceMetadataIdentifier);
+        Thread.sleep(INTERVAL_TO_MAKE_NACOS_REFRESH);
+        serviceMetaData = configService.getConfig(serviceMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP, NACOS_READ_TIMEOUT);
+        Assertions.assertNull(serviceMetaData);
+    }
+
+    @Test
+    public void testDoGetExportedURLs() throws InterruptedException, NacosException {
+        URL url = URL.valueOf("xxx://" + NetUtils.getLocalAddress().getHostName() + ":4444/" + TEST_SERVICE +
+                "?paramTest=nacosTest&version=" + VERSION + "&application="
+                + APPLICATION_NAME + (METADATA_GROUP == null ? "" : "&group=" + METADATA_GROUP));
+        ServiceMetadataIdentifier serviceMetadataIdentifier = new ServiceMetadataIdentifier(TEST_SERVICE, VERSION,
+                METADATA_GROUP, "provider", REVISION, PROTOCOL);
+
+        nacosMetadataReport.doSaveMetadata(serviceMetadataIdentifier, url);
+        Thread.sleep(INTERVAL_TO_MAKE_NACOS_REFRESH);
+
+        List<String> exportedURLs = nacosMetadataReport.doGetExportedURLs(serviceMetadataIdentifier);
+        Assertions.assertTrue(exportedURLs.size() == 1);
+
+        String exportedUrl = exportedURLs.get(0);
+        Assertions.assertNotNull(exportedUrl);
+        Assertions.assertEquals(exportedUrl, url.toFullString());
+
+        //clear test data
+        configService.removeConfig(serviceMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP);
+    }
+
+    @Test
+    public void testDoSaveSubscriberData() throws InterruptedException, NacosException {
+        URL url = URL.valueOf("xxx://" + NetUtils.getLocalAddress().getHostName() + ":4444/" + TEST_SERVICE +
+                "?paramTest=nacosTest&version=" + VERSION + "&application="
+                + APPLICATION_NAME + (METADATA_GROUP == null ? "" : "&group=" + METADATA_GROUP));
+        SubscriberMetadataIdentifier subscriberMetadataIdentifier = new SubscriberMetadataIdentifier(APPLICATION_NAME, REVISION);
+        Gson gson = new Gson();
+        String urlListJsonString = gson.toJson(Arrays.asList(url));
+        nacosMetadataReport.doSaveSubscriberData(subscriberMetadataIdentifier, urlListJsonString);
+        Thread.sleep(INTERVAL_TO_MAKE_NACOS_REFRESH);
+
+        String subscriberMetadata = configService.getConfig(subscriberMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP, NACOS_READ_TIMEOUT);
+        Assertions.assertNotNull(subscriberMetadata);
+        Assertions.assertEquals(subscriberMetadata, urlListJsonString);
+
+        //clear test data
+        configService.removeConfig(subscriberMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), NACOS_GROUP);
+
     }
 
     private MetadataIdentifier storeProvider(NacosMetadataReport nacosMetadataReport, String interfaceName, String version,
@@ -103,7 +230,7 @@ public class NacosMetadataReportTest {
                 ServiceDefinitionBuilder.buildFullDefinition(interfaceClass, url.getParameters());
 
         nacosMetadataReport.storeProviderMetadata(providerMetadataIdentifier, fullServiceDefinition);
-        Thread.sleep(1000);
+        Thread.sleep(INTERVAL_TO_MAKE_NACOS_REFRESH);
         return providerMetadataIdentifier;
     }
 
@@ -113,7 +240,8 @@ public class NacosMetadataReportTest {
         Map<String, String> tmp = new HashMap<>();
         tmp.put("paramConsumerTest", "nacosConsumer");
         nacosMetadataReport.storeConsumerMetadata(consumerIdentifier, tmp);
-        Thread.sleep(1000);
+        Thread.sleep(INTERVAL_TO_MAKE_NACOS_REFRESH);
         return consumerIdentifier;
     }
+
 }


[dubbo] 07/07: fix typo (#5834)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 2.7.6-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit e0ff2effb61e049ed9cf50017f9c1e9deba12168
Author: GungnirLaevatain <54...@qq.com>
AuthorDate: Sun Mar 8 15:29:52 2020 +0800

    fix typo (#5834)
---
 .../src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java b/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java
index 784b5a0..0da56fa 100644
--- a/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java
+++ b/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java
@@ -70,7 +70,7 @@ import static org.apache.dubbo.remoting.etcd.Constants.RETRY_PERIOD_KEY;
 import static org.apache.dubbo.remoting.etcd.jetcd.JEtcdClientWrapper.UTF_8;
 
 /**
- * etct3 client.
+ * etcd3 client.
  */
 public class JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> {
 


[dubbo] 06/07: fix wrong telnet command package(#5690) (#5815)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 2.7.6-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit ab5cf3dfb74fbcfaa6f453a5a3222faa32e10fe1
Author: xylsh <de...@gmail.com>
AuthorDate: Sat Mar 7 23:16:40 2020 +0800

    fix wrong telnet command package(#5690) (#5815)
---
 .../org.apache.dubbo.remoting.telnet.TelnetHandler     | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.remoting.telnet.TelnetHandler b/dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.remoting.telnet.TelnetHandler
index 9911163..0ce7b09 100644
--- a/dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.remoting.telnet.TelnetHandler
+++ b/dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.remoting.telnet.TelnetHandler
@@ -1,9 +1,9 @@
-ls=org.apache.dubbo.rpc.protocol.dubbo.telnet.ListTelnetHandler
-ps=org.apache.dubbo.rpc.protocol.dubbo.telnet.PortTelnetHandler
-cd=org.apache.dubbo.rpc.protocol.dubbo.telnet.ChangeTelnetHandler
-pwd=org.apache.dubbo.rpc.protocol.dubbo.telnet.CurrentTelnetHandler
-invoke=org.apache.dubbo.rpc.protocol.dubbo.telnet.InvokeTelnetHandler
-trace=org.apache.dubbo.rpc.protocol.dubbo.telnet.TraceTelnetHandler
-count=org.apache.dubbo.rpc.protocol.dubbo.telnet.CountTelnetHandler
-select=org.apache.dubbo.rpc.protocol.dubbo.telnet.SelectTelnetHandler
-shutdown=org.apache.dubbo.rpc.protocol.dubbo.telnet.ShutdownTelnetHandler
\ No newline at end of file
+ls=org.apache.dubbo.qos.legacy.ListTelnetHandler
+ps=org.apache.dubbo.qos.legacy.PortTelnetHandler
+cd=org.apache.dubbo.qos.legacy.ChangeTelnetHandler
+pwd=org.apache.dubbo.qos.legacy.CurrentTelnetHandler
+invoke=org.apache.dubbo.qos.legacy.InvokeTelnetHandler
+trace=org.apache.dubbo.qos.legacy.TraceTelnetHandler
+count=org.apache.dubbo.qos.legacy.CountTelnetHandler
+select=org.apache.dubbo.qos.legacy.SelectTelnetHandler
+shutdown=org.apache.dubbo.qos.legacy.ShutdownTelnetHandler
\ No newline at end of file


[dubbo] 03/07: [CI] add source and javadoc jar to snapshot

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 2.7.6-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 5f8a5316c4106cca3a8094b06daefc3f44b03ac4
Author: Huang YunKun <ht...@gmail.com>
AuthorDate: Fri Mar 6 18:43:28 2020 +0800

    [CI] add source and javadoc jar to snapshot
---
 Jenkinsfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index ebf2d30..65f1773 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -106,9 +106,9 @@ pipeline {
                 }
             }
             steps {
-                timeout(35) {
+                timeout(40) {
                     sh './mvnw --version'
-                    sh './mvnw clean package deploy -pl dubbo-dependencies-bom && ./mvnw clean package deploy -DskipTests=true'
+                    sh './mvnw clean source:jar javadoc:jar package deploy -pl dubbo-dependencies-bom && ./mvnw clean package deploy -DskipTests=true'
                 }
             }
         }


[dubbo] 05/07: set EXTENSION_LOADERS/EXTENSION_INSTANCE default size to 64 (#5812)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 2.7.6-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 9e2bb2d40a8070cf17f2a4fc51ad9d524b88ad23
Author: xylsh <de...@gmail.com>
AuthorDate: Sat Mar 7 16:08:12 2020 +0800

    set EXTENSION_LOADERS/EXTENSION_INSTANCE default size to 64 (#5812)
---
 .../main/java/org/apache/dubbo/common/extension/ExtensionLoader.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java
index 842a43f..b53729e 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java
@@ -87,9 +87,9 @@ public class ExtensionLoader<T> {
 
     private static final Pattern NAME_SEPARATOR = Pattern.compile("\\s*[,]+\\s*");
 
-    private static final ConcurrentMap<Class<?>, ExtensionLoader<?>> EXTENSION_LOADERS = new ConcurrentHashMap<>();
+    private static final ConcurrentMap<Class<?>, ExtensionLoader<?>> EXTENSION_LOADERS = new ConcurrentHashMap<>(64);
 
-    private static final ConcurrentMap<Class<?>, Object> EXTENSION_INSTANCES = new ConcurrentHashMap<>();
+    private static final ConcurrentMap<Class<?>, Object> EXTENSION_INSTANCES = new ConcurrentHashMap<>(64);
 
     private final Class<?> type;
 


[dubbo] 01/07: extracting duplicate code in CountTelnetHandler (#5824)

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 2.7.6-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit a97265020806f26bb61053ea5fa97bb61c883e83
Author: Huang YunKun <ht...@gmail.com>
AuthorDate: Thu Mar 5 07:01:28 2020 -0600

    extracting duplicate code in CountTelnetHandler (#5824)
---
 .../dubbo/qos/legacy/CountTelnetHandler.java       | 28 ++++++++++------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/legacy/CountTelnetHandler.java b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/legacy/CountTelnetHandler.java
index 3b79bea..cab2799 100644
--- a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/legacy/CountTelnetHandler.java
+++ b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/legacy/CountTelnetHandler.java
@@ -130,14 +130,7 @@ public class CountTelnetHandler implements TelnetHandler {
         if (method == null || method.length() == 0) {
             for (Method m : invoker.getInterface().getMethods()) {
                 RpcStatus count = RpcStatus.getStatus(url, m.getName());
-                List<String> row = new ArrayList<String>();
-                row.add(m.getName());
-                row.add(String.valueOf(count.getTotal()));
-                row.add(String.valueOf(count.getFailed()));
-                row.add(String.valueOf(count.getActive()));
-                row.add(String.valueOf(count.getSucceededAverageElapsed()) + "ms");
-                row.add(String.valueOf(count.getSucceededMaxElapsed()) + "ms");
-                table.add(row);
+                table.add(createRow(m.getName(),count));
             }
         } else {
             boolean found = false;
@@ -149,14 +142,7 @@ public class CountTelnetHandler implements TelnetHandler {
             }
             if (found) {
                 RpcStatus count = RpcStatus.getStatus(url, method);
-                List<String> row = new ArrayList<String>();
-                row.add(method);
-                row.add(String.valueOf(count.getTotal()));
-                row.add(String.valueOf(count.getFailed()));
-                row.add(String.valueOf(count.getActive()));
-                row.add(String.valueOf(count.getSucceededAverageElapsed()) + "ms");
-                row.add(String.valueOf(count.getSucceededMaxElapsed()) + "ms");
-                table.add(row);
+                table.add(createRow(method,count));
             } else {
                 return "No such method " + method + " in class " + invoker.getInterface().getName();
             }
@@ -164,4 +150,14 @@ public class CountTelnetHandler implements TelnetHandler {
         return TelnetUtils.toTable(header, table);
     }
 
+    private List<String> createRow(String methodName,RpcStatus count) {
+        List<String> row = new ArrayList<String>();
+        row.add(methodName);
+        row.add(String.valueOf(count.getTotal()));
+        row.add(String.valueOf(count.getFailed()));
+        row.add(String.valueOf(count.getActive()));
+        row.add(count.getSucceededAverageElapsed() + "ms");
+        row.add(count.getSucceededMaxElapsed() + "ms");
+        return row;
+    }
 }


[dubbo] 04/07: [CI] fix source jar upload issue for snapshot

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 2.7.6-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit b7730b3c781ea289590d5c859e04403b5ce7248b
Author: Huang YunKun <ht...@gmail.com>
AuthorDate: Fri Mar 6 21:28:59 2020 +0800

    [CI] fix source jar upload issue for snapshot
---
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 65f1773..15eda40 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -108,7 +108,7 @@ pipeline {
             steps {
                 timeout(40) {
                     sh './mvnw --version'
-                    sh './mvnw clean source:jar javadoc:jar package deploy -pl dubbo-dependencies-bom && ./mvnw clean package deploy -DskipTests=true'
+                    sh './mvnw clean package deploy -pl dubbo-dependencies-bom && ./mvnw clean source:jar javadoc:jar package deploy -DskipTests=true'
                 }
             }
         }