Repository: alibaba/fescar
Pull request #421 (2019-02-18 09:10:26)

[master] release 0.2.1
<!-- Please make sure you have read and understood the contributing guidelines -->

### Ⅰ. Describe what this PR did

[master] release 0.2.1

### Ⅱ. Does this pull request fix one issue?
[master] release 0.2.1


### Ⅲ. Why don't you add test cases (unit test/integration test)? 


### Ⅳ. Describe how to verify it


### Ⅴ. Special notes for reviews



codecov-io: # [Codecov](https://codecov.io/gh/alibaba/fescar/pull/421?src=pr&el=h1) Report
> Merging [#421](https://codecov.io/gh/alibaba/fescar/pull/421?src=pr&el=desc) into [master](https://codecov.io/gh/alibaba/fescar/commit/34b6115934232e6c4f1c71636890faf0c24c29dd?src=pr&el=desc) will **increase** coverage by `0.09%`.
> The diff coverage is `69.23%`.

[![Impacted file tree graph](https://codecov.io/gh/alibaba/fescar/pull/421/graphs/tree.svg?width=650&token=Hy9a6MCc4p&height=150&src=pr)](https://codecov.io/gh/alibaba/fescar/pull/421?src=pr&el=tree)

```diff
@@             Coverage Diff              @@
##             master     #421      +/-   ##
============================================
+ Coverage     29.59%   29.68%   +0.09%     
- Complexity      621      626       +5     
============================================
  Files           175      176       +1     
  Lines          6947     6962      +15     
  Branches        844      848       +4     
============================================
+ Hits           2056     2067      +11     
- Misses         4676     4677       +1     
- Partials        215      218       +3
```


| [Impacted Files](https://codecov.io/gh/alibaba/fescar/pull/421?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...java/com/alibaba/fescar/core/protocol/Version.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbWFpbi9qYXZhL2NvbS9hbGliYWJhL2Zlc2Nhci9jb3JlL3Byb3RvY29sL1ZlcnNpb24uamF2YQ==) | `0% <ø> (ø)` | `0 <0> (ø)` | :arrow_down: |
| [...aba/fescar/discovery/registry/RegistryFactory.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-ZGlzY292ZXJ5L3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvZmVzY2FyL2Rpc2NvdmVyeS9yZWdpc3RyeS9SZWdpc3RyeUZhY3RvcnkuamF2YQ==) | `53.33% <ø> (ø)` | `2 <0> (ø)` | :arrow_down: |
| [...car/discovery/loadbalance/AbstractLoadBalance.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-ZGlzY292ZXJ5L3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvZmVzY2FyL2Rpc2NvdmVyeS9sb2FkYmFsYW5jZS9BYnN0cmFjdExvYWRCYWxhbmNlLmphdmE=) | `66.66% <ø> (+33.33%)` | `3 <0> (+1)` | :arrow_up: |
| [...scar/discovery/loadbalance/LoadBalanceFactory.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-ZGlzY292ZXJ5L3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvZmVzY2FyL2Rpc2NvdmVyeS9sb2FkYmFsYW5jZS9Mb2FkQmFsYW5jZUZhY3RvcnkuamF2YQ==) | `40% <ø> (ø)` | `1 <0> (ø)` | :arrow_down: |
| [...r/discovery/registry/NacosRegistryServiceImpl.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-ZGlzY292ZXJ5L3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvZmVzY2FyL2Rpc2NvdmVyeS9yZWdpc3RyeS9OYWNvc1JlZ2lzdHJ5U2VydmljZUltcGwuamF2YQ==) | `0% <ø> (ø)` | `0 <0> (ø)` | :arrow_down: |
| [...ar/discovery/registry/FileRegistryServiceImpl.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-ZGlzY292ZXJ5L3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvZmVzY2FyL2Rpc2NvdmVyeS9yZWdpc3RyeS9GaWxlUmVnaXN0cnlTZXJ2aWNlSW1wbC5qYXZh) | `56% <ø> (ø)` | `5 <0> (ø)` | :arrow_down: |
| [...com/alibaba/fescar/core/rpc/netty/RmRpcClient.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbWFpbi9qYXZhL2NvbS9hbGliYWJhL2Zlc2Nhci9jb3JlL3JwYy9uZXR0eS9SbVJwY0NsaWVudC5qYXZh) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: |
| [...ibaba/fescar/core/rpc/netty/NettyClientConfig.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbWFpbi9qYXZhL2NvbS9hbGliYWJhL2Zlc2Nhci9jb3JlL3JwYy9uZXR0eS9OZXR0eUNsaWVudENvbmZpZy5qYXZh) | `40.62% <100%> (ø)` | `19 <1> (ø)` | :arrow_down: |
| [...escar/discovery/loadbalance/RandomLoadBalance.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-ZGlzY292ZXJ5L3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvZmVzY2FyL2Rpc2NvdmVyeS9sb2FkYmFsYW5jZS9SYW5kb21Mb2FkQmFsYW5jZS5qYXZh) | `100% <100%> (ø)` | `2 <2> (?)` | |
| [...com/alibaba/fescar/core/rpc/netty/TmRpcClient.java](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbWFpbi9qYXZhL2NvbS9hbGliYWJhL2Zlc2Nhci9jb3JlL3JwYy9uZXR0eS9UbVJwY0NsaWVudC5qYXZh) | `24.24% <100%> (ø)` | `12 <0> (ø)` | :arrow_down: |
| ... and [4 more](https://codecov.io/gh/alibaba/fescar/pull/421/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/alibaba/fescar/pull/421?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/alibaba/fescar/pull/421?src=pr&el=footer). Last update [34b6115...22ef4fe](https://codecov.io/gh/alibaba/fescar/pull/421?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/README.md b/README.md
index 3768c9715..9579919c9 100644
--- a/README.md
+++ b/README.md
@@ -65,7 +65,7 @@ For more details about principle and design, please go to [Fescar wiki page](htt
 
 ## Maven dependency
 ```xml
-<fescar.version>0.1.4</fescar.version>
+<fescar.version>0.2.0</fescar.version>
 
 <dependency>
     <groupId>com.alibaba.fescar</groupId>
diff --git a/common/pom.xml b/common/pom.xml
index 3e70b1f60..3b8dd9d93 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-common</artifactId>
diff --git a/config/pom.xml b/config/pom.xml
index 5e072caed..a42c786a1 100644
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-config</artifactId>
diff --git a/core/pom.xml b/core/pom.xml
index 6ae32d9ae..105855811 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-core</artifactId>
diff --git a/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java b/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
index c770862a5..f0a80f576 100644
--- a/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
+++ b/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
@@ -31,7 +31,7 @@ public class Version {
     /**
      * The constant CURRENT.
      */
-    public static final String CURRENT = "0.2.0";
+    public static final String CURRENT = "0.2.1";
 
     /**
      * The constant VERSION_MAP.
diff --git a/core/src/main/java/com/alibaba/fescar/core/rpc/netty/NettyClientConfig.java b/core/src/main/java/com/alibaba/fescar/core/rpc/netty/NettyClientConfig.java
index 51872a6fb..07af6db81 100644
--- a/core/src/main/java/com/alibaba/fescar/core/rpc/netty/NettyClientConfig.java
+++ b/core/src/main/java/com/alibaba/fescar/core/rpc/netty/NettyClientConfig.java
@@ -51,7 +51,7 @@ public class NettyClientConfig extends NettyBaseConfig {
     private static final int DEFAULT_MIN_POOL_IDLE = 0;
     private static final boolean DEFAULT_POOL_TEST_BORROW = true;
     private static final boolean DEFAULT_POOL_TEST_RETURN = true;
-    private static final boolean DEFAULT_POOL_FIFO = true;
+    private static final boolean DEFAULT_POOL_LIFO = true;
 
     /**
      * Gets connect timeout millis.
@@ -423,8 +423,8 @@ public class NettyClientConfig extends NettyBaseConfig {
      *
      * @return the boolean
      */
-    public boolean isPoolFifo() {
-        return DEFAULT_POOL_FIFO;
+    public boolean isPoolLifo() {
+        return DEFAULT_POOL_LIFO;
     }
 
     /**
diff --git a/core/src/main/java/com/alibaba/fescar/core/rpc/netty/RmRpcClient.java b/core/src/main/java/com/alibaba/fescar/core/rpc/netty/RmRpcClient.java
index 212349ade..2f57ee260 100644
--- a/core/src/main/java/com/alibaba/fescar/core/rpc/netty/RmRpcClient.java
+++ b/core/src/main/java/com/alibaba/fescar/core/rpc/netty/RmRpcClient.java
@@ -190,7 +190,7 @@ public final class RmRpcClient extends AbstractRpcRemotingClient {
         poolConfig.maxWait = rmClientConfig.getMaxAcquireConnMills();
         poolConfig.testOnBorrow = rmClientConfig.isPoolTestBorrow();
         poolConfig.testOnReturn = rmClientConfig.isPoolTestReturn();
-        poolConfig.lifo = rmClientConfig.isPoolFifo();
+        poolConfig.lifo = rmClientConfig.isPoolLifo();
         return poolConfig;
     }
 
diff --git a/core/src/main/java/com/alibaba/fescar/core/rpc/netty/TmRpcClient.java b/core/src/main/java/com/alibaba/fescar/core/rpc/netty/TmRpcClient.java
index 5cdd38af1..5632b1678 100644
--- a/core/src/main/java/com/alibaba/fescar/core/rpc/netty/TmRpcClient.java
+++ b/core/src/main/java/com/alibaba/fescar/core/rpc/netty/TmRpcClient.java
@@ -83,7 +83,7 @@ public final class TmRpcClient extends AbstractRpcRemotingClient {
     private final AtomicBoolean initialized = new AtomicBoolean(false);
     private String applicationId;
     private String transactionServiceGroup;
-    private final NettyClientConfig nettyClientConfig;
+    private final NettyClientConfig tmClientConfig;
     private final ConcurrentMap<String, NettyPoolKey> poolKeyMap
         = new ConcurrentHashMap<String, NettyPoolKey>();
     /**
@@ -95,7 +95,7 @@ public final class TmRpcClient extends AbstractRpcRemotingClient {
                         EventExecutorGroup eventExecutorGroup,
                         ThreadPoolExecutor messageExecutor) {
         super(nettyClientConfig, eventExecutorGroup, messageExecutor);
-        this.nettyClientConfig = nettyClientConfig;
+        this.tmClientConfig = nettyClientConfig;
     }
 
     /**
@@ -357,12 +357,12 @@ public final class TmRpcClient extends AbstractRpcRemotingClient {
     @Override
     protected Config getNettyPoolConfig() {
         Config poolConfig = new Config();
-        poolConfig.maxActive = nettyClientConfig.getMaxPoolActive();
-        poolConfig.minIdle = nettyClientConfig.getMinPoolIdle();
-        poolConfig.maxWait = nettyClientConfig.getMaxAcquireConnMills();
-        poolConfig.testOnBorrow = nettyClientConfig.isPoolTestBorrow();
-        poolConfig.testOnReturn = nettyClientConfig.isPoolTestReturn();
-        poolConfig.lifo = nettyClientConfig.isPoolFifo();
+        poolConfig.maxActive = tmClientConfig.getMaxPoolActive();
+        poolConfig.minIdle = tmClientConfig.getMinPoolIdle();
+        poolConfig.maxWait = tmClientConfig.getMaxAcquireConnMills();
+        poolConfig.testOnBorrow = tmClientConfig.isPoolTestBorrow();
+        poolConfig.testOnReturn = tmClientConfig.isPoolTestReturn();
+        poolConfig.lifo = tmClientConfig.isPoolLifo();
         return poolConfig;
     }
 
diff --git a/discovery/pom.xml b/discovery/pom.xml
index 83dd445c2..fc169cff4 100644
--- a/discovery/pom.xml
+++ b/discovery/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <packaging>jar</packaging>
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/AbstractLoadBalance.java b/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/AbstractLoadBalance.java
index 6b6fad1ac..a52004a99 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/AbstractLoadBalance.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/AbstractLoadBalance.java
@@ -21,8 +21,10 @@ import java.util.List;
 import com.alibaba.nacos.client.naming.utils.CollectionUtils;
 
 /**
- * @author: jimin.jm@alibaba-inc.com
- * @date 2019/02/12
+ * The type Abstract load balance.
+ *
+ * @author: jimin.jm @alibaba-inc.com
+ * @date 2019 /02/12
  */
 public abstract class AbstractLoadBalance implements LoadBalance {
 
@@ -37,5 +39,12 @@ public abstract class AbstractLoadBalance implements LoadBalance {
         return doSelect(invokers);
     }
 
+    /**
+     * Do select t.
+     *
+     * @param <T>      the type parameter
+     * @param invokers the invokers
+     * @return the t
+     */
     protected abstract <T> T doSelect(List<T> invokers);
 }
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceFactory.java b/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceFactory.java
index 0af624235..939239cb3 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceFactory.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceFactory.java
@@ -19,11 +19,18 @@ package com.alibaba.fescar.discovery.loadbalance;
 import java.util.ServiceLoader;
 
 /**
- * @author: jimin.jm@alibaba-inc.com
- * @date 2019/02/12
+ * The type Load balance factory.
+ *
+ * @author: jimin.jm @alibaba-inc.com
+ * @date 2019 /02/12
  */
 public class LoadBalanceFactory {
 
+    /**
+     * Gets instance.
+     *
+     * @return the instance
+     */
     public static LoadBalance getInstance() {
         ServiceLoader<LoadBalance> serviceLoader = ServiceLoader.load(LoadBalance.class);
         for (LoadBalance loadBalance : serviceLoader) {
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/RandomLoadBalance.java b/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/RandomLoadBalance.java
new file mode 100644
index 000000000..0b0a4a963
--- /dev/null
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/RandomLoadBalance.java
@@ -0,0 +1,19 @@
+package com.alibaba.fescar.discovery.loadbalance;
+
+import java.util.List;
+import java.util.Random;
+
+/**
+ * @author: yuoyao
+ * @date 2019/02/14
+ */
+public class RandomLoadBalance extends AbstractLoadBalance {
+
+    private final Random random=new Random();
+
+    @Override
+    protected <T> T doSelect(List<T> invokers) {
+        int length=invokers.size();
+        return invokers.get(random.nextInt(length));
+    }
+}
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/RoundRobinLoadBalance.java b/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/RoundRobinLoadBalance.java
index 86dbfad96..2c795c909 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/RoundRobinLoadBalance.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/loadbalance/RoundRobinLoadBalance.java
@@ -17,15 +17,32 @@
 package com.alibaba.fescar.discovery.loadbalance;
 
 import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
- * @author: jimin.jm@alibaba-inc.com
- * @date 2019/02/12
+ * The type Round robin load balance.
+ *
+ * @author: jimin.jm @alibaba-inc.com
+ * @date 2019 /02/12
  */
 public class RoundRobinLoadBalance extends AbstractLoadBalance {
+
+    private final AtomicInteger sequence  = new AtomicInteger();
+
     @Override
     protected <T> T doSelect(List<T> invokers) {
-        //todo
-        return invokers.get(0);
+        int length=invokers.size();
+        return invokers.get(getPositiveSequence() % length);
     }
+
+    private int getPositiveSequence() {
+        for (;;) {
+            int current = sequence.get();
+            int next = (current >= Integer.MAX_VALUE ? 0 : current + 1);
+            if (sequence.compareAndSet(current, next)) {
+                return current;
+            }
+        }
+    }
+
 }
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/FileRegistryServiceImpl.java b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/FileRegistryServiceImpl.java
index fed395d06..c04eb1c79 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/FileRegistryServiceImpl.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/FileRegistryServiceImpl.java
@@ -27,8 +27,10 @@ import com.alibaba.fescar.config.ConfigurationFactory;
 import org.apache.commons.lang.StringUtils;
 
 /**
- * @author: jimin.jm@alibaba-inc.com
- * @date 2019/02/12
+ * The type File registry service.
+ *
+ * @author: jimin.jm @alibaba-inc.com
+ * @date 2019 /02/12
  */
 public class FileRegistryServiceImpl implements RegistryService<ConfigChangeListener> {
     private static volatile FileRegistryServiceImpl instance;
@@ -39,6 +41,11 @@ public class FileRegistryServiceImpl implements RegistryService<ConfigChangeList
 
     private FileRegistryServiceImpl() {}
 
+    /**
+     * Gets instance.
+     *
+     * @return the instance
+     */
     public static FileRegistryServiceImpl getInstance() {
         if (null == instance) {
             synchronized (FileRegistryServiceImpl.class) {
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/NacosRegistryServiceImpl.java b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/NacosRegistryServiceImpl.java
index 10e03f605..57cb08e1a 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/NacosRegistryServiceImpl.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/NacosRegistryServiceImpl.java
@@ -60,6 +60,11 @@ public class NacosRegistryServiceImpl implements RegistryService<EventListener>
 
     private NacosRegistryServiceImpl() {}
 
+    /**
+     * Gets instance.
+     *
+     * @return the instance
+     */
     public static NacosRegistryServiceImpl getInstance() {
         if (null == instance) {
             synchronized (NacosRegistryServiceImpl.class) {
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryFactory.java b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryFactory.java
index acfc71ccd..863f7848f 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryFactory.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryFactory.java
@@ -28,15 +28,22 @@ import static com.alibaba.fescar.config.ConfigurationFactory.FILE_ROOT_REGISTRY;
 import static com.alibaba.fescar.config.ConfigurationFactory.FILE_ROOT_TYPE;
 
 /**
- * @Author: jimin.jm@alibaba-inc.com
- * @Project: fescar-all
- * @DateTime: 2019/2/1 5:57 PM
+ * The type Registry factory.
+ *
+ * @Author: jimin.jm @alibaba-inc.com
+ * @Project: fescar -all
+ * @DateTime: 2019 /2/1 5:57 PM
  * @FileName: RegistryFactory
  * @Description:
  */
 public class RegistryFactory {
     private static final Logger LOGGER = LoggerFactory.getLogger(RegistryFactory.class);
 
+    /**
+     * Gets instance.
+     *
+     * @return the instance
+     */
     public static RegistryService getInstance() {
         ConfigType configType = null;
         try {
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryService.java b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryService.java
index 61a903629..b8689a655 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryService.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryService.java
@@ -31,8 +31,17 @@ import java.util.List;
  */
 public interface RegistryService<T> {
 
+    /**
+     * The constant PREFIX_SERVICE_MAPPING.
+     */
     String PREFIX_SERVICE_MAPPING = "vgroup_mapping.";
+    /**
+     * The constant PREFIX_SERVICE_ROOT.
+     */
     String PREFIX_SERVICE_ROOT = "service";
+    /**
+     * The constant CONFIG_SPLIT_CHAR.
+     */
     String CONFIG_SPLIT_CHAR = ".";
 
     /**
diff --git a/distribution/pom.xml b/distribution/pom.xml
index bd6a6a77c..f142afed8 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-distribution</artifactId>
diff --git a/dubbo-alibaba/pom.xml b/dubbo-alibaba/pom.xml
new file mode 100644
index 000000000..74561d8ec
--- /dev/null
+++ b/dubbo-alibaba/pom.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Copyright 1999-2018 Alibaba Group Holding Ltd.
+  ~
+  ~  Licensed 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.
+  -->
+
+<project xmlns="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">
+    <parent>
+        <artifactId>fescar-all</artifactId>
+        <groupId>com.alibaba.fescar</groupId>
+        <version>0.2.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>fescar-dubbo-alibaba</artifactId>
+    <name>fescar-dubbo-alibaba ${project.version}</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>fescar-tm</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>dubbo</artifactId>
+            <version>2.6.5</version>
+        </dependency>
+    </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/dubbo-alibaba/src/main/java/com/alibaba/fescar/dubbo/alibaba/TransactionPropagationFilter.java b/dubbo-alibaba/src/main/java/com/alibaba/fescar/dubbo/alibaba/TransactionPropagationFilter.java
new file mode 100644
index 000000000..3e91e94b8
--- /dev/null
+++ b/dubbo-alibaba/src/main/java/com/alibaba/fescar/dubbo/alibaba/TransactionPropagationFilter.java
@@ -0,0 +1,78 @@
+/*
+ *  Copyright 1999-2018 Alibaba Group Holding Ltd.
+ *
+ *  Licensed 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.fescar.dubbo.alibaba;
+
+import com.alibaba.dubbo.common.Constants;
+import com.alibaba.dubbo.common.extension.Activate;
+import com.alibaba.dubbo.rpc.Filter;
+import com.alibaba.dubbo.rpc.Invocation;
+import com.alibaba.dubbo.rpc.Invoker;
+import com.alibaba.dubbo.rpc.Result;
+import com.alibaba.dubbo.rpc.RpcContext;
+import com.alibaba.dubbo.rpc.RpcException;
+import com.alibaba.fescar.core.context.RootContext;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The type Transaction propagation filter.
+ */
+@Activate(group = {Constants.PROVIDER, Constants.CONSUMER}, order = 100)
+public class TransactionPropagationFilter implements Filter {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(TransactionPropagationFilter.class);
+
+    @Override
+    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
+        String xid = RootContext.getXID();
+        String rpcXid = RpcContext.getContext().getAttachment(RootContext.KEY_XID);
+        if (LOGGER.isDebugEnabled()) {
+            LOGGER.debug("xid in RootContext[" + xid + "] xid in RpcContext[" + rpcXid + "]");
+        }
+        boolean bind = false;
+        if (xid != null) {
+            RpcContext.getContext().setAttachment(RootContext.KEY_XID, xid);
+        } else {
+            if (rpcXid != null) {
+                RootContext.bind(rpcXid);
+                bind = true;
+                if (LOGGER.isDebugEnabled()) {
+                    LOGGER.debug("bind[" + rpcXid + "] to RootContext");
+                }
+            }
+        }
+        try {
+            return invoker.invoke(invocation);
+
+        } finally {
+            if (bind) {
+                String unbindXid = RootContext.unbind();
+                if (LOGGER.isDebugEnabled()) {
+                    LOGGER.debug("unbind[" + unbindXid + "] from RootContext");
+                }
+                if (!rpcXid.equalsIgnoreCase(unbindXid)) {
+                    LOGGER.warn("xid in change during RPC from " + rpcXid + " to " + unbindXid);
+                    if (unbindXid != null) {
+                        RootContext.bind(unbindXid);
+                        LOGGER.warn("bind [" + unbindXid + "] back to RootContext");
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/dubbo-alibaba/src/main/resources/META-INF/services/com.alibaba.dubbo.rpc.Filter b/dubbo-alibaba/src/main/resources/META-INF/services/com.alibaba.dubbo.rpc.Filter
new file mode 100644
index 000000000..edaac3f8a
--- /dev/null
+++ b/dubbo-alibaba/src/main/resources/META-INF/services/com.alibaba.dubbo.rpc.Filter
@@ -0,0 +1,17 @@
+#
+#  Copyright 1999-2018 Alibaba Group Holding Ltd.
+#
+#  Licensed 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.
+#
+
+com.alibaba.fescar.dubbo.alibaba.TransactionPropagationFilter
\ No newline at end of file
diff --git a/dubbo/pom.xml b/dubbo/pom.xml
index c95b87602..d0adee391 100644
--- a/dubbo/pom.xml
+++ b/dubbo/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-dubbo</artifactId>
diff --git a/dubbo/src/main/resources/META-INF/services/com.alibaba.dubbo.rpc.Filter b/dubbo/src/main/resources/META-INF/services/com.alibaba.dubbo.rpc.Filter
deleted file mode 100644
index 590dc2a47..000000000
--- a/dubbo/src/main/resources/META-INF/services/com.alibaba.dubbo.rpc.Filter
+++ /dev/null
@@ -1,1 +0,0 @@
-com.alibaba.fescar.dubbo.TransactionPropagationFilter
\ No newline at end of file
diff --git a/dubbo/src/main/resources/META-INF/services/org.apache.dubbo.rpc.Filter b/dubbo/src/main/resources/META-INF/services/org.apache.dubbo.rpc.Filter
new file mode 100644
index 000000000..ba968248b
--- /dev/null
+++ b/dubbo/src/main/resources/META-INF/services/org.apache.dubbo.rpc.Filter
@@ -0,0 +1,17 @@
+#
+#  Copyright 1999-2018 Alibaba Group Holding Ltd.
+#
+#  Licensed 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.
+#
+
+com.alibaba.fescar.dubbo.TransactionPropagationFilter
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 90bbfc46e..415c6c753 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
 
     <groupId>com.alibaba.fescar</groupId>
     <artifactId>fescar-all</artifactId>
-    <version>0.2.0</version>
+    <version>0.2.1</version>
     <modules>
         <module>config</module>
         <module>common</module>
@@ -34,6 +34,7 @@
         <module>dubbo</module>
         <module>discovery</module>
         <module>test</module>
+        <module>dubbo-alibaba</module>
     </modules>
     <packaging>pom</packaging>
 
diff --git a/rm-datasource/pom.xml b/rm-datasource/pom.xml
index f70f90984..d5fcff68b 100644
--- a/rm-datasource/pom.xml
+++ b/rm-datasource/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-rm-datasource</artifactId>
diff --git a/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/sql/druid/MySQLUpdateRecognizer.java b/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/sql/druid/MySQLUpdateRecognizer.java
index 20b061590..5a0cc15df 100644
--- a/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/sql/druid/MySQLUpdateRecognizer.java
+++ b/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/sql/druid/MySQLUpdateRecognizer.java
@@ -21,11 +21,7 @@ import java.util.List;
 
 import com.alibaba.druid.sql.ast.SQLExpr;
 import com.alibaba.druid.sql.ast.SQLStatement;
-import com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr;
-import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
-import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;
-import com.alibaba.druid.sql.ast.expr.SQLValuableExpr;
-import com.alibaba.druid.sql.ast.expr.SQLVariantRefExpr;
+import com.alibaba.druid.sql.ast.expr.*;
 import com.alibaba.druid.sql.ast.statement.SQLExprTableSource;
 import com.alibaba.druid.sql.ast.statement.SQLUpdateSetItem;
 import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUpdateStatement;
@@ -124,9 +120,19 @@ public class MySQLUpdateRecognizer extends BaseRecognizer implements SQLUpdateRe
         if (where == null) {
             return "";
         }
+
+
         StringBuffer sb = new StringBuffer();
         MySqlOutputVisitor visitor = new MySqlOutputVisitor(sb);
-        visitor.visit((SQLBinaryOpExpr) where);
+
+        if(where instanceof SQLBetweenExpr){
+            visitor.visit((SQLBetweenExpr) where);
+        }else if(where instanceof SQLInListExpr){
+            visitor.visit((SQLInListExpr) where);
+        }else{
+            visitor.visit((SQLBinaryOpExpr) where);
+        }
+
         return sb.toString();
     }
 
diff --git a/server/pom.xml b/server/pom.xml
index d343f9527..813e308e4 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-server</artifactId>
diff --git a/spring/pom.xml b/spring/pom.xml
index d36277782..dc92233ab 100644
--- a/spring/pom.xml
+++ b/spring/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-spring</artifactId>
diff --git a/tm/pom.xml b/tm/pom.xml
index 3f410a524..f5fd6e01b 100644
--- a/tm/pom.xml
+++ b/tm/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-tm</artifactId>


Test patch:
diff --git a/core/src/test/java/com/alibaba/fescar/core/rpc/netty/TmRpcClientTest.java b/core/src/test/java/com/alibaba/fescar/core/rpc/netty/TmRpcClientTest.java
index c4f034e96..1c1a6d526 100644
--- a/core/src/test/java/com/alibaba/fescar/core/rpc/netty/TmRpcClientTest.java
+++ b/core/src/test/java/com/alibaba/fescar/core/rpc/netty/TmRpcClientTest.java
@@ -59,7 +59,7 @@ public class TmRpcClientTest {
         Assert.assertEquals(defaultNettyClientConfig.getMaxAcquireConnMills(), config.maxWait);
         Assert.assertEquals(defaultNettyClientConfig.isPoolTestBorrow(), config.testOnBorrow);
         Assert.assertEquals(defaultNettyClientConfig.isPoolTestReturn(), config.testOnReturn);
-        Assert.assertEquals(defaultNettyClientConfig.isPoolFifo(), config.lifo);
+        Assert.assertEquals(defaultNettyClientConfig.isPoolLifo(), config.lifo);
     }
 
     /**
diff --git a/discovery/src/test/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceFactoryTest.java b/discovery/src/test/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceFactoryTest.java
index 5a7d00eb4..d1dddf0ae 100644
--- a/discovery/src/test/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceFactoryTest.java
+++ b/discovery/src/test/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceFactoryTest.java
@@ -29,11 +29,19 @@ import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 /**
- * @author: jimin.jm@alibaba-inc.com
- * @date 2019/02/12
+ * The type Load balance factory test.
+ *
+ * @author: jimin.jm @alibaba-inc.com
+ * @date 2019 /02/12
  */
 public class LoadBalanceFactoryTest {
 
+    /**
+     * Test get registry.
+     *
+     * @param loadBalance the load balance
+     * @throws Exception the exception
+     */
     @Test(dataProvider = "instanceProvider")
     @Ignore
     public void testGetRegistry(LoadBalance loadBalance) throws Exception {
@@ -48,6 +56,12 @@ public class LoadBalanceFactoryTest {
         Assert.assertNotNull(balanceAddress);
     }
 
+    /**
+     * Test get address.
+     *
+     * @param loadBalance the load balance
+     * @throws Exception the exception
+     */
     @Test(dataProvider = "instanceProvider")
     public void testGetAddress(LoadBalance loadBalance) throws Exception {
         Assert.assertNotNull(loadBalance);
@@ -58,6 +72,11 @@ public class LoadBalanceFactoryTest {
         Assert.assertEquals(address, balanceAddress);
     }
 
+    /**
+     * Instance provider object [ ] [ ].
+     *
+     * @return the object [ ] [ ]
+     */
     @DataProvider
     public static Object[][] instanceProvider() {
         LoadBalance loadBalance = LoadBalanceFactory.getInstance();
diff --git a/discovery/src/test/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceTest.java b/discovery/src/test/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceTest.java
new file mode 100644
index 000000000..dfb0febda
--- /dev/null
+++ b/discovery/src/test/java/com/alibaba/fescar/discovery/loadbalance/LoadBalanceTest.java
@@ -0,0 +1,71 @@
+package com.alibaba.fescar.discovery.loadbalance;
+
+import org.testng.Assert;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.testng.collections.Lists;
+
+import java.net.InetSocketAddress;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * Created by guoyao on 2019/2/14.
+ */
+public class LoadBalanceTest {
+
+
+    @Test(dataProvider = "addressProvider")
+    public void testRandomLoadBalance_select(List<InetSocketAddress> addresses) {
+        int runs=10000;
+        Map<InetSocketAddress, AtomicLong> counter=getSelectedCounter(runs, addresses, new RandomLoadBalance());
+        for (InetSocketAddress address : counter.keySet()) {
+            Long count=counter.get(address).get();
+            Assert.assertTrue(count > 0, "selecte one time at last");
+        }
+    }
+
+    @Test(dataProvider = "addressProvider")
+    public void testRoundRobinLoadBalance_select(List<InetSocketAddress> addresses) {
+        int runs=10000;
+        Map<InetSocketAddress, AtomicLong> counter=getSelectedCounter(runs,addresses, new RoundRobinLoadBalance());
+        for (InetSocketAddress address : counter.keySet()) {
+            Long count=counter.get(address).get();
+            Assert.assertTrue(Math.abs(count - runs / (0f + addresses.size())) < 1f,"abs diff shoud < 1");
+        }
+    }
+
+    public Map<InetSocketAddress, AtomicLong> getSelectedCounter(int runs, List<InetSocketAddress> addresses, LoadBalance loadBalance) {
+        Assert.assertNotNull(loadBalance);
+        Map<InetSocketAddress, AtomicLong> counter=new ConcurrentHashMap<>();
+        for (InetSocketAddress address : addresses) {
+            counter.put(address, new AtomicLong(0));
+        }
+        try {
+            for (int i=0; i < runs; i++) {
+                InetSocketAddress selectAddress=loadBalance.select(addresses);
+                counter.get(selectAddress).incrementAndGet();
+            }
+        } catch (Exception e) {
+            //do nothing
+        }
+        return counter;
+    }
+
+    @DataProvider
+    public static Object[][] addressProvider() {
+        List<InetSocketAddress> addresses=Lists.newArrayList();
+        addresses.add(new InetSocketAddress("127.0.0.1", 8091));
+        addresses.add(new InetSocketAddress("127.0.0.1", 8092));
+        addresses.add(new InetSocketAddress("127.0.0.1", 8093));
+        addresses.add(new InetSocketAddress("127.0.0.1", 8094));
+        addresses.add(new InetSocketAddress("127.0.0.1", 8095));
+        return new Object[][]{{addresses}};
+    }
+
+
+
+
+}
diff --git a/test/pom.xml b/test/pom.xml
index 2d5912ff4..b1877c4f4 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.2.0</version>
+        <version>0.2.1</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-test</artifactId>