Hi,

In the context of the Multiplexing DocumentStore work for Oak [1] I'm
going to work on a tool to extract a few subpaths from a DS repository
which can then be plugged in a different repository.

The objective is to generate a 'private mount' which can be used
together with a different 'global repository'. For instance:

- create a repository (R1) , populate /foo and /bar with some content
- extract data for /foo and /bar from R1
- pre-populate a DS 'storage area' ( MongoDB collection or RDB table )
with the data extracted above
- configure a new repository (R2) to mount /foo and /bar with the data
from above

The main inconvenient is that many times commmits which affect /foo and
/bar are have the commit root at '/', so the collections extracted
using something like oak-run.js' printMongoExportCommand will not work.

I have two possible ways of doing this, so before experimenting I'd
like to discuss with you whether these are valid ways of approaching
the problem or if there's something better:

1) Manually create a new commit for each sub-path ( e.g. 1 for /foo and
1 for /bar ) and re-write the commit references for each node document
so that they point to the new commits

2) For each sub-path, copy the nodes into a temporary staging area (
e.g. /foo -> /staging/foo, or even /:staging/foo ), export the data,
and then manually alter the references.

Approach 1) is probably going to get me in trouble with the
DocumentNodeStore caches, so the Oak instance might not be usable after
I perform these changes ( which can be fine, since I'm going to spin it
up just for that ).

Approach 2) might get me branch commits, which are always rooted at the
'/', which invalidates the approach. Also, path find/replace sounds
error prone.

Any ideas how to best approach this?

Thanks,

Robert

[1]: https://issues.apache.org/jira/browse/OAK-3401

Reply via email to