Exactly,

in Zookeeper alls paths are forward slashes (as it is a "path" inside the 
zookeeper environment). If you replace that with a NIO Windows Path it creates 
backslashes. This makes Zookeeper fail (of course).

Actually using the Hadoop class is broken workaround, it may be better to use 
the java.net.URI class for correct "path" transformations. The risk with 
java.nio.file.Path is also that if the path exists in file system it handles 
the resolving different. So if some user has for some reason a local path 
exactly looking like a zookeper node path it would use different behaviour.

So my suggestion: Use java.net.URI to build the path and use URI.getPath() or 
similar to make a String out of it. The alternative to replace all backslashes 
in the path to forwards slashes is a bad idea for the reasons I explained 
before.

BTW, Windows is happy again!

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: u...@thetaphi.de

> -----Original Message-----
> From: Erick Erickson <erickerick...@gmail.com>
> Sent: Thursday, July 16, 2020 1:40 AM
> To: dev@lucene.apache.org
> Subject: Re: Policeman Jenkins lost it's "/view/Lucene-Solr/"
> 
> Let me try something. In the “you’ve got to be joking” category. Tell me you
> wouldn’t have made the same mistake ;)
> 
> In several places:
> 
> String parent = new Path(leaderPath).getParent().toString();
> 
> was replaced with:
> 
> String parent = Paths.get(leaderPath).getParent().toString();
> 
> BUT, the new Path bit is actually a in org.apache.hadoop.fs that has lines 
> like:
> 
> if (hasWindowsDrive(pathString) && pathString.charAt(0) != '/') {
>   pathString = "/" + pathString;
> }
> 
> And a number of the erorrs are about how “blah doesn’t begin with /“.
> 
> I’ll fix this and push and we’ll see. If that’s not it, we should revert but 
> we won’t
> know until tomorrow.
> 
> Erick
> 
> > On Jul 15, 2020, at 11:27 AM, Uwe Schindler <u...@thetaphi.de> wrote:
> >
> > RoutingToNodesWithPropertiesTest
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to