[incubator-dubbo-website] branch asf-site updated: update dubbo admin doc (#167)

2018-10-25 Thread min
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/asf-site by this push:
 new 04e4046  update dubbo admin doc (#167)
04e4046 is described below

commit 04e4046ede81ad5718a5477bc75fc1e235321647
Author: min 
AuthorDate: Thu Oct 25 17:01:12 2018 +0800

update dubbo admin doc (#167)

* fix routing rule mistake

* update dubbo ops doc
---
 docs/en-us/admin/install/admin-console.md  |  32 +++
 docs/en-us/admin/install/simple-monitor-center.md  |  93 +---
 docs/en-us/admin/install/simple-registry-center.md |  77 -
 docs/en-us/admin/ops/dubbo-ops.md  |  20 ++---
 .../admin/sources/images/dubbo-add-config.jpg  | Bin 0 -> 303596 bytes
 .../admin/sources/images/dubbo-add-config.png  | Bin 100926 -> 0 bytes
 .../en-us/admin/sources/images/dubbo-add-route.jpg | Bin 0 -> 330146 bytes
 .../en-us/admin/sources/images/dubbo-add-route.png | Bin 139777 -> 0 bytes
 .../en-us/admin/sources/images/dubbo-consumers.jpg | Bin 0 -> 274307 bytes
 .../en-us/admin/sources/images/dubbo-consumers.png | Bin 101859 -> 0 bytes
 .../en-us/admin/sources/images/dubbo-providers.jpg | Bin 0 -> 272674 bytes
 .../en-us/admin/sources/images/dubbo-providers.png | Bin 98504 -> 0 bytes
 docs/en-us/admin/sources/images/dubbo-search.jpg   | Bin 0 -> 224751 bytes
 docs/en-us/admin/sources/images/dubbo-search.png   | Bin 65761 -> 0 bytes
 docs/zh-cn/admin/install/admin-console.md  |  36 
 docs/zh-cn/admin/install/simple-monitor-center.md  |  94 +
 docs/zh-cn/admin/install/simple-registry-center.md |  79 +
 docs/zh-cn/admin/ops/dubbo-ops.md  |  23 ++---
 .../admin/sources/images/dubbo-add-config.jpg  | Bin 0 -> 303596 bytes
 .../admin/sources/images/dubbo-add-config.png  | Bin 100926 -> 0 bytes
 .../zh-cn/admin/sources/images/dubbo-add-route.jpg | Bin 0 -> 330146 bytes
 .../zh-cn/admin/sources/images/dubbo-add-route.png | Bin 139777 -> 0 bytes
 .../zh-cn/admin/sources/images/dubbo-consumers.jpg | Bin 0 -> 274307 bytes
 .../zh-cn/admin/sources/images/dubbo-consumers.png | Bin 101859 -> 0 bytes
 .../zh-cn/admin/sources/images/dubbo-providers.jpg | Bin 0 -> 272674 bytes
 .../zh-cn/admin/sources/images/dubbo-providers.png | Bin 98504 -> 0 bytes
 docs/zh-cn/admin/sources/images/dubbo-search.jpg   | Bin 0 -> 224751 bytes
 docs/zh-cn/admin/sources/images/dubbo-search.png   | Bin 65761 -> 0 bytes
 28 files changed, 42 insertions(+), 412 deletions(-)

diff --git a/docs/en-us/admin/install/admin-console.md 
b/docs/en-us/admin/install/admin-console.md
index 516a4f6..1963df8 100644
--- a/docs/en-us/admin/install/admin-console.md
+++ b/docs/en-us/admin/install/admin-console.md
@@ -1,28 +1,23 @@
 # Install admin console
 
-Include: route rule, dynamic configuration, service downgrade, access control, 
weight adjustment, load balance, etc.
+The current version of dubbo admin is under development, including: route 
rule, dynamic configuration, access control, weight adjustment, load balance, 
etc.
 
 Install:
 
 ```sh
-wget 
http://apache.etoak.com/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz
-tar zxvf apache-tomcat-6.0.35.tar.gz
-cd apache-tomcat-6.0.35
-rm -rf webapps/ROOT
-
-git clone https://github.com/dubbo/dubbo-ops.git /var/tmp/dubbo-ops
-pushd /var/tmp/dubbo-ops
+git clone https://github.com/apache/incubator-dubbo-ops.git /var/tmp/dubbo-ops
+cd /var/tmp/dubbo-ops
 mvn clean package
-popd
-
-unzip /var/tmp/dubbo-ops/dubbo-admin/target/dubbo-admin-2.0.0.war -d 
webapps/ROOT
 ```
 
 Configuration [^1]:
 
 ```sh
-vi webapps/ROOT/WEB-INF/dubbo.properties
-dubbo.properties
+configuration file:
+dubbo-admin-backend/src/main/resources/application.properties
+dubbo-admin-backend/src/main/resources/application-develop.properties
+dubbo-admin-backend/src/main/resources/application-production.properties
+configurations:
 dubbo.registry.address=zookeeper://127.0.0.1:2181
 dubbo.admin.root.password=root
 dubbo.admin.guest.password=guest
@@ -31,20 +26,19 @@ dubbo.admin.guest.password=guest
 Start:
 
 ```sh
-./bin/startup.sh
+mvn --projects dubbo-admin-backend spring-boot:run
 ```
 
-Stop:
+For more information, please visit:
 
 ```sh
-./bin/shutdown.sh
+https://github.com/apache/incubator-dubbo-ops
 ```
 
 Visit [^2]:
 
 ```
-http://127.0.0.1:8080/
+http://127.0.0.1:8080
 ```
 
-[^1]: Or put `dubbo.properties` in current user directory
-[^2]: User: root, password: root or user: guest, password: guest
+[^1]: There's no login for current version, will be added later
\ No newline at end of file
diff --git a/docs/en-us/admin/install/simple-monitor-center.md 
b/docs/en-us/admin/install/simple-monitor-center.md
index 7e9a715..f66b79f 100644
--- a/docs/en-us/admin/install/simple-monitor-center.md
+++ b/docs/en-us/admin/instal

[incubator-dubbo-website] branch asf-site updated: correct a spelling mistake in xml.md (#164)

2018-10-25 Thread jerrick
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/asf-site by this push:
 new 4058fe9  correct a spelling mistake in xml.md (#164)
4058fe9 is described below

commit 4058fe9c44b71bec7aace2f46eefddb84ee9ae32
Author: SuperIllidan 
AuthorDate: Thu Oct 25 17:10:04 2018 +0800

correct a spelling mistake in xml.md (#164)
---
 docs/en-us/user/configuration/xml.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/en-us/user/configuration/xml.md 
b/docs/en-us/user/configuration/xml.md
index 6789ffc..b6162da 100644
--- a/docs/en-us/user/configuration/xml.md
+++ b/docs/en-us/user/configuration/xml.md
@@ -45,7 +45,7 @@ Or:
 
 tag  | purpose | introduction
 - | - | -
-`` | Service Export  | Used to export service, define service 
metadata, export service with mutiple protocols, register service to multiple 
registries
+`` | Service Export  | Used to export service, define service 
metadata, export service with multiple protocols, register service to multiple 
registries
 ``  | Service Reference  | Used to create a remote proxy, 
subscribe to multiple registries
 ``  | Protocol Config  | Configure the protocol for services 
on provider side, the consumer side follows.
 ``  | Application Config  | Applies to both provider and 
consumer.



[incubator-dubbo-ops] branch develop updated: update codecov

2018-10-25 Thread min
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 946be4e  update codecov
946be4e is described below

commit 946be4e44ec5dda63babce573447ae7f54b7d885
Author: nzomkxia 
AuthorDate: Fri Oct 26 10:18:31 2018 +0800

update codecov
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index dba4c65..bf88f1b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ jdk:
 - oraclejdk11
 - oraclejdk8
 script:
-- travis_wait 30 mvn clean package
+- travis_wait 30 mvn clean cobertura:cobertura package
 
 after_success:
   - bash <(curl -s https://codecov.io/bash)



[incubator-dubbo-ops] branch develop updated: update codecov

2018-10-25 Thread min
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 1a24605  update codecov
1a24605 is described below

commit 1a246051b2ed72212eec524621d97528ee5cda4e
Author: nzomkxia 
AuthorDate: Fri Oct 26 10:42:53 2018 +0800

update codecov
---
 .travis.yml |  2 +-
 pom.xml | 24 
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index bf88f1b..dba4c65 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ jdk:
 - oraclejdk11
 - oraclejdk8
 script:
-- travis_wait 30 mvn clean cobertura:cobertura package
+- travis_wait 30 mvn clean package
 
 after_success:
   - bash <(curl -s https://codecov.io/bash)
diff --git a/pom.xml b/pom.xml
index 4677df6..986d206 100644
--- a/pom.xml
+++ b/pom.xml
@@ -112,5 +112,29 @@


 
+   
+   
+   
+   org.jacoco
+   jacoco-maven-plugin
+   0.8.1
+   
+   
+   
+   
prepare-agent
+   
+   
+   
+   report
+   test
+   
+   report
+   
+   
+   
+   
+   
+   
+
 
 



[incubator-dubbo] branch master updated: [Dubbo-1983] Support Protobuf Serialization (#2618)

2018-10-25 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 ac013b1  [Dubbo-1983] Support Protobuf Serialization (#2618)
ac013b1 is described below

commit ac013b1a658c6dd2e08a541054373f0265cec5fb
Author: Song Kun 
AuthorDate: Fri Oct 26 11:06:09 2018 +0800

[Dubbo-1983] Support Protobuf Serialization (#2618)

* finish support protobuf

* polish

* fix code review

* use the general test for serialization
---
 .../dubbo-serialization-protobuf/pom.xml   |  60 
 .../serialize/protobuf/ProtobufObjectInput.java| 158 +
 .../serialize/protobuf/ProtobufObjectOutput.java   | 121 
 .../serialize/protobuf/ProtobufSerialization.java  |  49 +++
 .../dubbo/common/serialize/protobuf/Wrapper.java   |  33 +
 .../serialize/protobuf/utils/WrapperUtils.java |  67 +
 ...org.apache.dubbo.common.serialize.Serialization |   1 +
 .../dubbo-serialization-test/pom.xml   |   5 +
 .../serialize/protobuf/ProtobufPersonOkTest.java   |  26 
 .../protobuf/ProtobufSerializationTest.java|  26 
 dubbo-serialization/pom.xml|   1 +
 11 files changed, 547 insertions(+)

diff --git a/dubbo-serialization/dubbo-serialization-protobuf/pom.xml 
b/dubbo-serialization/dubbo-serialization-protobuf/pom.xml
new file mode 100644
index 000..d1843b0
--- /dev/null
+++ b/dubbo-serialization/dubbo-serialization-protobuf/pom.xml
@@ -0,0 +1,60 @@
+
+
+http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+4.0.0
+
+dubbo-serialization
+org.apache.dubbo
+2.7.0-SNAPSHOT
+
+
+dubbo-serialization-protobuf
+jar
+${project.artifactId}
+The protobuf serialization module of dubbo 
project
+
+
+1.5.9
+
+
+
+
+org.apache.dubbo
+dubbo-serialization-api
+${project.parent.version}
+
+
+io.protostuff
+protostuff-core
+${protobuf.version}
+
+
+io.protostuff
+protostuff-runtime
+${protobuf.version}
+
+
+org.objenesis
+objenesis
+2.6
+
+
+
+
\ No newline at end of file
diff --git 
a/dubbo-serialization/dubbo-serialization-protobuf/src/main/java/org/apache/dubbo/common/serialize/protobuf/ProtobufObjectInput.java
 
b/dubbo-serialization/dubbo-serialization-protobuf/src/main/java/org/apache/dubbo/common/serialize/protobuf/ProtobufObjectInput.java
new file mode 100644
index 000..64773e9
--- /dev/null
+++ 
b/dubbo-serialization/dubbo-serialization-protobuf/src/main/java/org/apache/dubbo/common/serialize/protobuf/ProtobufObjectInput.java
@@ -0,0 +1,158 @@
+/*
+ * 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 org.apache.dubbo.common.serialize.protobuf;
+
+import io.protostuff.ProtobufIOUtil;
+import io.protostuff.Schema;
+import io.protostuff.runtime.RuntimeSchema;
+import org.apache.dubbo.common.serialize.ObjectInput;
+import org.apache.dubbo.common.serialize.protobuf.utils.WrapperUtils;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Type;
+
+public class ProtobufObjectInput implements ObjectInput {
+
+private DataInputStream dis;
+
+public ProtobufObjectInput(InputStream inputStream) {
+dis = new DataInputStream(inputStream);
+}
+
+@SuppressWarnings("ResultOfMethodCallIgnored")
+@Override
+public Object readObject() throws IOException, ClassNotFoundException {
+int classNameLength = dis.readInt();
+int bytesLength = dis.readInt();
+
+if (classNameLength < 0 || bytesLength < 0) {
+throw new IOException();
+}
+
+byte[] classNameBytes = new byte[classNameLength];
+dis.

[incubator-dubbo] branch 2.6.x updated: Smooth Round Robin selection (#2647)

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

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


The following commit(s) were added to refs/heads/2.6.x by this push:
 new e4725cd  Smooth Round Robin selection (#2647)
e4725cd is described below

commit e4725cd687e52637e7c6a107e9dc6840d1fbac75
Author: jasonjoo2010 
AuthorDate: Fri Oct 26 11:35:17 2018 +0800

Smooth Round Robin selection (#2647)
---
 .../cluster/loadbalance/RoundRobinLoadBalance.java | 166 -
 .../com/alibaba/dubbo/rpc/cluster/StickyTest.java  |   6 +-
 .../rpc/cluster/loadbalance/LoadBalanceTest.java   | 262 +
 .../support/AbstractClusterInvokerTest.java|  10 +-
 4 files changed, 333 insertions(+), 111 deletions(-)

diff --git 
a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
 
b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
index 9d4d026..fa03e9d 100644
--- 
a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
+++ 
b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
@@ -17,87 +17,141 @@
 package com.alibaba.dubbo.rpc.cluster.loadbalance;
 
 import com.alibaba.dubbo.common.URL;
-import com.alibaba.dubbo.common.utils.AtomicPositiveInteger;
 import com.alibaba.dubbo.rpc.Invocation;
 import com.alibaba.dubbo.rpc.Invoker;
 
-import java.util.LinkedHashMap;
+import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * Round robin load balance.
+ * 
+ * Smoothly round robin's implementation @since 2.6.5 
+ * @author jason
  *
  */
 public class RoundRobinLoadBalance extends AbstractLoadBalance {
-
 public static final String NAME = "roundrobin";
+
+private static int RECYCLE_PERIOD = 6;
+
+protected static class WeightedRoundRobin {
+private int weight;
+private AtomicLong current = new AtomicLong(0);
+private long lastUpdate;
+public int getWeight() {
+return weight;
+}
+public void setWeight(int weight) {
+this.weight = weight;
+current.set(0);
+}
+public long increaseCurrent() {
+return current.addAndGet(weight);
+}
+public void sel(int total) {
+current.addAndGet(-1 * total);
+}
+public long getLastUpdate() {
+return lastUpdate;
+}
+public void setLastUpdate(long lastUpdate) {
+this.lastUpdate = lastUpdate;
+}
+}
 
-private final ConcurrentMap sequences = new 
ConcurrentHashMap();
-
+private ConcurrentMap> 
methodWeightMap = new ConcurrentHashMap>();
+private AtomicBoolean updateLock = new AtomicBoolean();
+
+/**
+ * get invoker addr list cached for specified invocation
+ * 
+ * for unit test only
+ * 
+ * @param invokers
+ * @param invocation
+ * @return
+ */
+protected  Collection getInvokerAddrList(List> 
invokers, Invocation invocation) {
+String key = invokers.get(0).getUrl().getServiceKey() + "." + 
invocation.getMethodName();
+Map map = methodWeightMap.get(key);
+if (map != null) {
+return map.keySet();
+}
+return null;
+}
+
 @Override
 protected  Invoker doSelect(List> invokers, URL url, 
Invocation invocation) {
 String key = invokers.get(0).getUrl().getServiceKey() + "." + 
invocation.getMethodName();
-int length = invokers.size(); // Number of invokers
-int maxWeight = 0; // The maximum weight
-int minWeight = Integer.MAX_VALUE; // The minimum weight
-final LinkedHashMap, IntegerWrapper> invokerToWeightMap = 
new LinkedHashMap, IntegerWrapper>();
-int weightSum = 0;
-for (int i = 0; i < length; i++) {
-int weight = getWeight(invokers.get(i), invocation);
-maxWeight = Math.max(maxWeight, weight); // Choose the maximum 
weight
-minWeight = Math.min(minWeight, weight); // Choose the minimum 
weight
-if (weight > 0) {
-invokerToWeightMap.put(invokers.get(i), new 
IntegerWrapper(weight));
-weightSum += weight;
-}
+ConcurrentMap map = 
methodWeightMap.get(key);
+if (map == null) {
+methodWeightMap.putIfAbsent(key, new ConcurrentHashMap());
+map = methodWeightMap.get(key);
 }
-AtomicPositiveInteger sequence = sequences.get(key);
-if (sequence == null) {
-sequences.putIfAbsent(key, new A

[incubator-dubbo] branch master updated: Smooth Round Robin selection (#2650)

2018-10-25 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 910b261  Smooth Round Robin selection (#2650)
910b261 is described below

commit 910b261a00066478f3e0d1dc8023771564981cfe
Author: jasonjoo2010 
AuthorDate: Fri Oct 26 13:27:18 2018 +0800

Smooth Round Robin selection (#2650)
---
 .../cluster/loadbalance/RoundRobinLoadBalance.java | 155 +++--
 .../org/apache/dubbo/rpc/cluster/StickyTest.java   |   4 +-
 .../cluster/loadbalance/LoadBalanceBaseTest.java   | 103 +++---
 .../loadbalance/RoundRobinLoadBalanceTest.java | 150 
 .../support/AbstractClusterInvokerTest.java|  12 +-
 5 files changed, 331 insertions(+), 93 deletions(-)

diff --git 
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
 
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
index f3b802e..e8f42cb 100644
--- 
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
+++ 
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
@@ -17,68 +17,139 @@
 package org.apache.dubbo.rpc.cluster.loadbalance;
 
 import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.utils.AtomicPositiveInteger;
 import org.apache.dubbo.rpc.Invocation;
 import org.apache.dubbo.rpc.Invoker;
 
-import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * Round robin load balance.
+ * 
+ * @author jason
  */
 public class RoundRobinLoadBalance extends AbstractLoadBalance {
-
 public static final String NAME = "roundrobin";
+
+private static int RECYCLE_PERIOD = 6;
+
+protected static class WeightedRoundRobin {
+private int weight;
+private AtomicLong current = new AtomicLong(0);
+private long lastUpdate;
+public int getWeight() {
+return weight;
+}
+public void setWeight(int weight) {
+this.weight = weight;
+current.set(0);
+}
+public long increaseCurrent() {
+return current.addAndGet(weight);
+}
+public void sel(int total) {
+current.addAndGet(-1 * total);
+}
+public long getLastUpdate() {
+return lastUpdate;
+}
+public void setLastUpdate(long lastUpdate) {
+this.lastUpdate = lastUpdate;
+}
+}
 
-private final ConcurrentMap sequences = new 
ConcurrentHashMap();
-
-private final ConcurrentMap indexSeqs = new 
ConcurrentHashMap();
-
+private ConcurrentMap> 
methodWeightMap = new ConcurrentHashMap>();
+private AtomicBoolean updateLock = new AtomicBoolean();
+
+/**
+ * get invoker addr list cached for specified invocation
+ * 
+ * for unit test only
+ * 
+ * @param invokers
+ * @param invocation
+ * @return
+ */
+protected  Collection getInvokerAddrList(List> 
invokers, Invocation invocation) {
+String key = invokers.get(0).getUrl().getServiceKey() + "." + 
invocation.getMethodName();
+Map map = methodWeightMap.get(key);
+if (map != null) {
+return map.keySet();
+}
+return null;
+}
+
 @Override
 protected  Invoker doSelect(List> invokers, URL url, 
Invocation invocation) {
 String key = invokers.get(0).getUrl().getServiceKey() + "." + 
invocation.getMethodName();
-int length = invokers.size(); // Number of invokers
-int maxWeight = 0; // The maximum weight
-int minWeight = Integer.MAX_VALUE; // The minimum weight
-final List> nonZeroWeightedInvokers = new ArrayList<>();
-for (int i = 0; i < length; i++) {
-int weight = getWeight(invokers.get(i), invocation);
-maxWeight = Math.max(maxWeight, weight); // Choose the maximum 
weight
-minWeight = Math.min(minWeight, weight); // Choose the minimum 
weight
-if (weight > 0) {
-nonZeroWeightedInvokers.add(invokers.get(i));
-}
-}
-AtomicPositiveInteger sequence = sequences.get(key);
-if (sequence == null) {
-sequences.putIfAbsent(key, new AtomicPositiveInteger());
-sequence = sequences.get(key);
+ConcurrentMap map = 
methodWeightMap.get(key);
+if (map == null) {
+methodWeightMap.putIfAbsent(key, new ConcurrentHashMap());
+map = method

[incubator-dubbo-ops] branch develop updated: add chinese doc

2018-10-25 Thread min
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
 new 7f667e6  add chinese doc
7f667e6 is described below

commit 7f667e6e570666f2daa7e417195b024a724dc376
Author: nzomkxia 
AuthorDate: Fri Oct 26 14:55:19 2018 +0800

add chinese doc
---
 README.md| 11 +
 README_ZH.md | 76 
 2 files changed, 82 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index f66ccec..a0b1e91 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@
 
[![codecov](https://codecov.io/gh/apache/incubator-dubbo-ops/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/incubator-dubbo-ops)
 
![license](https://img.shields.io/github/license/apache/incubator-dubbo-ops.svg)
 
+[中文说明](README_ZH.md)
 ### Screenshot
 
 
![index](https://raw.githubusercontent.com/apache/incubator-dubbo-ops/develop/doc/images/index.png)
@@ -46,29 +47,29 @@
* Select configuration files in Intellij Idea 
 
   1. Choose profile file during project importing   
- 1. In the **Import from Maven** page where IntelliJ IDEA displays the 
profiles, activate the ones you need: 
+ 1. In the **Import from Maven** page where IntelliJ IDEA displays the 
profiles, select `develop` maven profile: 
   
![profile](https://raw.githubusercontent.com/apache/incubator-dubbo-ops/develop/doc/images/profile-idea.jpg)
  2.  Select **Next** and finish import
 
   2.  Choose profile file in the Maven Projects tool window to activate 
profiles.  
   1. Open the Maven Projects tool window.  
   2. Click the Profiles node to open a list of declared profiles.  
-  3. Select the appropriate checkboxes to activate the profiles you 
need.
+  3. Select the appropriate checkboxes to activate `develop` maven 
profile.
   
 * Select configuration files in Eclipse
 1. import project
 2. In **Project Explorer**, right click `dubbo-admin-backend`
 3. Choose **Maven**->**Select Maven Profiles**
-4. Select profile you need
+4. Select `develop` maven profile
 
![profile-eclipse](https://raw.githubusercontent.com/apache/incubator-dubbo-ops/develop/doc/images/profile-eclipse.jpg)
 * Run backend project  
backend is a standard spring boot project, you can run it in any java IDE
 * Run frontend project  
   run with `npm run dev`
 * visit webpage
-  visit `http://localhost:8081`, frontend support hot reload. 
+  visit `http://localhost:8081`, frontend supports hot reload. 
  * CORS problem
-in this development mode, frontend will request `localhost:8080` to fetch 
data, this will cause a CORS problem, so we add a configuration in 
`I18nConfig.java` to support CORS, this configuration will only be active under 
**develop** mode, please select the right maven profile to support this.
+for convenien of development, we deploy frontend and backend separately, 
so the frontend supports hot reload. In this mode, frontend will request 
`localhost:8080` to fetch data, this will cause a CORS problem, so we add a 
configuration in `I18nConfig.java` to support CORS, this configuration will 
only be active under **develop** mode, please select the right maven profile to 
support this.
 
 ### Swagger supoort
 
diff --git a/README_ZH.md b/README_ZH.md
new file mode 100644
index 000..7c045cd
--- /dev/null
+++ b/README_ZH.md
@@ -0,0 +1,76 @@
+# Dubbo控制台
+
+[![Build 
Status](https://travis-ci.org/apache/incubator-dubbo-ops.svg?branch=master)](https://travis-ci.org/apache/incubator-dubbo-ops)
+[![codecov](https://codecov.io/gh/apache/incubator-dubbo-ops/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/incubator-dubbo-ops)
+![license](https://img.shields.io/github/license/apache/incubator-dubbo-ops.svg)
+
+English version goes [here](README.md).
+
+### 页面截图
+
+![index](https://raw.githubusercontent.com/apache/incubator-dubbo-ops/develop/doc/images/index.png)
+
+### 前端部分
+
+- 
使用[Vue.js](https://vuejs.org)作为javascript框架,[Vuetify](https://vuetifyjs.com)作为UI框架
+- [dubbo-admin-frontend/README.md](dubbo-admin-frontend/README.md)中有更详细的介绍
+
+### 后端部分
+
+* 配置文件  
+
+> - `application.properties`  
+>   公共配置文件
+> - `application-production.properties` (默认配置)  
+>   生产环境的配置文件
+> - `application-develop.properties`  
+>   开发环境的配置文件
+> 
+
+
+### 生产环境配置  
+
+1. 下载代码: `git clone https://github.com/apache/incubator-dubbo-ops.git`
+2. 在 
`dubbo-admin-backend/src/resources/application-production.properties`中指定注册中心地址
+3. 构建   
+
+* 通过命令行来指定maven active file  
+
+> - `mvn clean package -Pproduction` 
激活生产环境的配置文件(`application-production.properties`)
+4. 启动 `mvn --projects dubbo-admin-backend spring-boot:run`
+5. 访问 `http://localhost:8080`
+
+
+### 开发环境配置
+* IDE设置  
+