[Yanel-dev] New Patch for Yarep: Bugfix

Balz Schreier balz.schreier at gmail.com
Mon Oct 25 11:01:23 CEST 2010


Hi Michael,

I have two questions for you:

1)
I now found the place in the source code where the content item gets copied
to the new location:
- see VirtualFileSystemNode.getInputStream()

this means that it only gets copied if it is read.

as described earlier, the VirtualFileSystemRepository.exists(Path) method
can be called at anytime BEFORE the node is actually read, so my suggestion
is that exists() should be extended in order to check also the "old" not
splitted path, even if splitting is enabled.

So I hope this makes it now clearer for you to review the patch.

2)
Another question in this context is:
- Should the "split" logic not only reside in the VirtualFileSystemRepostory
class? I think that the node class should not know anything about the
splitting as it should deal with a content item only.
- Is there not an issue with the current implementation? If a node gets
copied from the old to the new location via getInputStream(), then the
repository's map still contains the old location, right? Again, if the logic
would be in the respository class only (so the repository class would copy
the node from old to new), than the repository class could also update the
map property accordinlgy after copying.
- If all the split logic would be in the repository class, then the
repository class could also delete the "old" node after copying it
successfully.

Cheers
Balz


On Mon, Oct 25, 2010 at 12:07 AM, Michael Wechner <michael.wechner at wyona.com
> wrote:

>  On 10/24/10 6:03 PM, Balz Schreier wrote:
>
> Hi,
>
>  I have fixed a bug in Yarep in the existsNode() method.
> Some weeks ago, splited file paths were introduced. It was implemented to
> be backwards compatible (see getNode() method), but backwards compatibili=
ty
> was not considered in the exists-method.
>
>
> you mean if you have a mix of splitted and non-splitted paths?
>
> IIRC Claudio implemented something like an automagic data migration for
> such
> cases, or did I miss something? I need to have a closer look at the code
> again ....
>
>
>
>  Please let me know by when this gets submitted to yarep svn.
>
>
> I cannot tell you right now :-(
>
> Cheers
>
> Michael
>
>
>  Cheers
> - B
>
>  Index:
> src/impl/java/org/wyona/yarep/impl/repo/vfs/VirtualFileSystemRepository.j=
ava
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> ---
> src/impl/java/org/wyona/yarep/impl/repo/vfs/VirtualFileSystemRepository.j=
ava (revision
> 54092)
> +++
> src/impl/java/org/wyona/yarep/impl/repo/vfs/VirtualFileSystemRepository.j=
ava (working
> copy)
> @@ -396,7 +396,7 @@
>              path =3D path.substring(0, path.length() - 1);
>          }
>          if (splitPathEnabled) {
> -            return map.exists(new Path(splitPath(path)));
> +            return map.exists(new Path(splitPath(path))) || map.exists(n=
ew
> Path(path));
>          } else {
>              return map.exists(new Path(path));
>          }
>
>
>
> --
> Yanel-development mailing list 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/2010102=
5/b0728ede/attachment.htm


More information about the Yanel-development mailing list