You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2018/03/19 09:32:18 UTC

[incubator-skywalking] 01/01: Fix zk path error.

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

wusheng pushed a commit to branch zk/bug/fix
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git

commit 161f11057a9d92e99f26472d0ff3bfa8ad208e58
Author: wu-sheng <wu...@foxmail.com>
AuthorDate: Mon Mar 19 17:31:36 2018 +0800

    Fix zk path error.
---
 .../apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java
index eb51be6..4def6a8 100644
--- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java
+++ b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java
@@ -34,6 +34,7 @@ import org.apache.skywalking.apm.collector.cluster.DataMonitor;
 import org.apache.skywalking.apm.collector.cluster.ModuleRegistration;
 import org.apache.skywalking.apm.collector.core.CollectorException;
 import org.apache.skywalking.apm.collector.core.util.CollectionUtils;
+import org.apache.skywalking.apm.util.StringUtil;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
@@ -165,7 +166,11 @@ public class ClusterZKDataMonitor implements DataMonitor, Watcher {
     }
 
     @Override public String getBaseCatalog() {
-        return "/" + namespace + "/skywalking";
+        if (StringUtil.isEmpty(namespace)) {
+            return "/skywalking";
+        } else {
+            return "/" + namespace + "/skywalking";
+        }
     }
 
     void setNamespace(String namespace) {

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