You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ni...@apache.org on 2019/04/08 08:13:09 UTC

[kylin] branch master updated: KYLIN-3935 ZKUtil acquire the wrong Zookeeper Path on windows

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

nic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new 80ac894  KYLIN-3935 ZKUtil acquire the wrong Zookeeper Path on windows
80ac894 is described below

commit 80ac894f36bd26780564c04a2eae43a7146a50af
Author: GinaZhai <na...@kyligence.io>
AuthorDate: Thu Apr 4 22:08:44 2019 +0800

    KYLIN-3935 ZKUtil acquire the wrong Zookeeper Path on windows
---
 core-common/src/main/java/org/apache/kylin/common/util/ZKUtil.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core-common/src/main/java/org/apache/kylin/common/util/ZKUtil.java b/core-common/src/main/java/org/apache/kylin/common/util/ZKUtil.java
index 5e02a19..fa3afa4 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/ZKUtil.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/ZKUtil.java
@@ -36,6 +36,7 @@ import org.apache.curator.utils.ZKPaths;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.kylin.common.KylinConfig;
 import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.Shell;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,7 +60,11 @@ public class ZKUtil {
         String path = ZKPaths.makePath(parent, child);
 
         try {
-            return new File(path).getCanonicalPath();
+            if (Shell.WINDOWS) {
+                return new File(path).toURI().getPath();
+            } else {
+                return new File(path).getCanonicalPath();
+            }
         } catch (IOException e) {
             logger.error("get canonical path failed, use original path", e);
             return path;