commit | db03f8c42b2cf33a9303233e31a4c9b8f88b836d | [log] [tgz] |
---|---|---|
author | whanice <ywh.ice@gmail.com> | Fri May 25 10:28:21 2018 +0800 |
committer | Ian Luo <ian.luo@gmail.com> | Fri May 25 10:28:21 2018 +0800 |
tree | f6393eed2d4663d9f7296c5e5c23b33f1652b3a7 | |
parent | 0bf6910b672add6363004010ab6421158c7097dd [diff] |
optimize_zk_create (#1833)
diff --git a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java index 9efd8b4..685effd 100644 --- a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java +++ b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java
@@ -52,12 +52,14 @@ @Override public void create(String path, boolean ephemeral) { + if (!ephemeral) { + if (checkExists(path)) { + return; + } + } int i = path.lastIndexOf('/'); if (i > 0) { - String parentPath = path.substring(0, i); - if (!checkExists(parentPath)) { - create(parentPath, false); - } + create(path.substring(0, i), false); } if (ephemeral) { createEphemeral(path);