You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@helix.apache.org by Ming Fang <mi...@mac.com> on 2013/03/05 06:33:29 UTC

ZkBaseDataAccessor path problem on Windows

I'm getting path problems on Windows.
Looking at line 104 and 584 of org.apache.helix.manager.zk.ZkBaseDataAccessor it looks like it is mixing up local file path with Zookeeper path.
In Zookeeper the file separator is always "/".
But ZkBaseDataAccessor will end up using "\" when running on Windows.

Re: ZkBaseDataAccessor path problem on Windows

Posted by kishore g <g....@gmail.com>.
Thanks Ming. I see the same problem in many other places, we should move
the fix to a util class.

 grep getParent `find . -name *.java`
./helix-core/src/main/java/org/apache/helix/manager/zk/Cache.java:
 String parentPath = new File(path).getParent();
./helix-core/src/main/java/org/apache/helix/manager/zk/WriteThroughCache.java:
   String parentPath = new File(path).getParent();
./helix-core/src/main/java/org/apache/helix/manager/zk/WriteThroughCache.java://
     String parentPath = new File(path).getParent();
./helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
       String parentPath = new File(path).getParent();
./helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java:
         String parentPath = new File(path).getParent();
./helix-core/src/main/java/org/apache/helix/manager/zk/ZkCallbackCache.java:
   String parentPath = new File(path).getParent();
./helix-core/src/main/java/org/apache/helix/manager/zk/ZkCallbackCache.java:
     String parentPath = new File(dataPath).getParent();
./helix-core/src/main/java/org/apache/helix/manager/zk/ZkCallbackCache.java:
     tmpPath = new File(tmpPath).getParent();




On Mon, Mar 4, 2013 at 10:23 PM, Ming Fang <mi...@mac.com> wrote:

> This is how I fixed it
>
> https://github.com/mingfang/apache-helix/commit/cb603f07e27989db198c2d72742ec8496c15ed02
>
> On Mar 5, 2013, at 1:22 AM, Zhen Zhang <ne...@gmail.com> wrote:
>
> Hi Ming, thanks for pointing out the problem. "new File(path).getParent()"
> is problematic on Windows platforms as the separator becomes "\". We will
> fix it. Filed a jira to track this:
>
> https://issues.apache.org/jira/browse/Helix-57
>
> Thanks,
> Jason
>
> On Mon, Mar 4, 2013 at 9:33 PM, Ming Fang <mi...@mac.com> wrote:
>
>> I'm getting path problems on Windows.
>> Looking at line 104 and 584 of
>> org.apache.helix.manager.zk.ZkBaseDataAccessor it looks like it is mixing
>> up local file path with Zookeeper path.
>> In Zookeeper the file separator is always "/".
>> But ZkBaseDataAccessor will end up using "\" when running on Windows.
>
>
>
>

Re: ZkBaseDataAccessor path problem on Windows

Posted by Ming Fang <mi...@mac.com>.
This is how I fixed it 
https://github.com/mingfang/apache-helix/commit/cb603f07e27989db198c2d72742ec8496c15ed02

On Mar 5, 2013, at 1:22 AM, Zhen Zhang <ne...@gmail.com> wrote:

> Hi Ming, thanks for pointing out the problem. "new File(path).getParent()" is problematic on Windows platforms as the separator becomes "\". We will fix it. Filed a jira to track this:
> 
> https://issues.apache.org/jira/browse/Helix-57
> 
> Thanks,
> Jason
> 
> On Mon, Mar 4, 2013 at 9:33 PM, Ming Fang <mi...@mac.com> wrote:
> I'm getting path problems on Windows.
> Looking at line 104 and 584 of org.apache.helix.manager.zk.ZkBaseDataAccessor it looks like it is mixing up local file path with Zookeeper path.
> In Zookeeper the file separator is always "/".
> But ZkBaseDataAccessor will end up using "\" when running on Windows.
> 


Re: ZkBaseDataAccessor path problem on Windows

Posted by Zhen Zhang <ne...@gmail.com>.
Hi Ming, thanks for pointing out the problem. "new File(path).getParent()"
is problematic on Windows platforms as the separator becomes "\". We will
fix it. Filed a jira to track this:

https://issues.apache.org/jira/browse/Helix-57

Thanks,
Jason

On Mon, Mar 4, 2013 at 9:33 PM, Ming Fang <mi...@mac.com> wrote:

> I'm getting path problems on Windows.
> Looking at line 104 and 584 of
> org.apache.helix.manager.zk.ZkBaseDataAccessor it looks like it is mixing
> up local file path with Zookeeper path.
> In Zookeeper the file separator is always "/".
> But ZkBaseDataAccessor will end up using "\" when running on Windows.