[Yanel-dev] Many fixes for the Split Path Topic: Final Patch
!
Michael Wechner
michael.wechner at wyona.com
Thu Nov 25 17:25:48 CET 2010
On 11/25/10 5:11 PM, Balz Schreier wrote:
> Hi Michael,
> I will create the patch again. I thought that I created it AFTER the =
> introduction of the new SplitPathConfig (see my mail where I describe =
> what that class is all about).
I think in order to make
svn diff > patch.txt
work one needs to "svn add" new classes, but that's a bit annoying for =
yourself ...
Cheers
Michael
> Cheers
> Balz
>
> On Thu, Nov 25, 2010 at 5:00 PM, Michael Wechner =
> <michael.wechner at wyona.com <mailto:michael.wechner at wyona.com>> wrote:
>
> Hi Balz
>
> I tried to compile your patch but failed, because
> SplitPathConfig.java seems to be missing.
> Also the class
> src/impl/java/org/wyona/yarep/impl/repo/treefs/map/TreeFileSystemMap.=
java
> needs
> to be patched because it seems that ignorePath has slightly changed.
>
> HTH
>
> Michael
>
>
> On 10/29/10 11:55 PM, Balz Schreier wrote:
>> Hi Michael,
>>
>> I spent the whole day on this topic, but at least it fully works
>> now as expected (except for the reindexing part).
>>
>> *What the patch includes:*
>> - As the split / unsplit logic is required at many places
>> (repository, node, maps, storage classes), I refactored it into a
>> new class where all the splitting and unsplitting complexity is
>> implemented:
>> org/wyona/yarep/core/impl/vfs/*SplitPathConfig.java*
>> - The following classes have been modified in order to use the
>> new SplitPathConfig class:
>>
>> org/wyona/yarep/core/impl/vfs/VFileSystemStorage.java
>> org/wyona/yarep/impl/VFileSystemMapImpl.java
>> org/wyona/yarep/impl/repo/vfs/VirtualFileSystemNode.java
>> org/wyona/yarep/impl/repo/vfs/VirtualFileSystemRepository.java
>>
>> - As written earlier, the original splitting algorithms had
>> errors! The algorithm used an escape character to replace the "/"
>> in the original URL but it did not escape itself (means if the
>> escape char occurred in the original string you don't know
>> anymore whether that was an + or a "/").
>>
>> So the new *splitting* algorithm does this (highlevel):
>> - replace all "+" by "++"
>> - replace all "/" by "+-"
>> - add now the real "/" which are used to create directories
>> - I also simplified the original code which inserts the "/". I
>> found the original code too complex, Java offers much simpler
>> ways of doing that... and it's easily readable: instead of
>> cryptic 15 lines it is now 5 lines long.
>>
>> *Unsplitting*:
>> - remove all "/", because all "/" are artificial
>> - go through the string from start to the end and replace the
>> tokens: ++ into + and +- into /
>>
>> *Hopefully correct?*
>> One area where I am unsure is the following:
>> 1) the data repository uses the class VirtualFileSystemRepository
>> (and ...Node). But also internally it uses the VFileSystemMapImpl
>> 2) other yarep repositories use two classes:
>> the VFileSystemMapImpl and the VFileSystemStorage
>>
>> I tested scenario 2) in all combinations: Map with split, Storage
>> without, and vice-versa. But it only worked fine if both were
>> configured with the split path logic. So there was no other
>> choice besides letting both classes know about the split stuff.
>>
>> In scenario 1) you told me that the repository class and the node
>> class both must be aware of the split stuff. That is ok. But I
>> was then a bit confused because the repository instantiates also
>> the MAP (from scenario 1) internally. Initially I thought, well
>> when the MAP anyway has the split logic implemented why not tell
>> it to consider it. But then I realized that the splitting gets
>> done twice. So the current implementation does the following:
>> Repository and Node both are aware of the splitting, but the map
>> impl is NOT aware of it.
>>
>> I tested quite a lot and it really seems to be fine now.
>>
>> Even the Reindexer works now!
>>
>> Cheers
>> Balz
>>
>
>
> --
> Yanel-development mailing list Yanel-development at wyona.com
> <mailto:Yanel-development at wyona.com>
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wyona.org/pipermail/yanel-development/attachments/2010112=
5/a3d54325/attachment.htm
More information about the Yanel-development
mailing list