For implementing CopyOnReadDirectory (OAK-1724) I need to copy the
Lucene index content to a local directory. However as there can be
multiple Lucene indexes and they may be at non root location
(OAK-2211) I need a way to map the JCR path of index to path on local
filesystem.

For e.g. if we have indexes defined at

/oak:index/lucene
/oak:index/prop1
/foo/oak:index/prop1
/foo/bar/oak:index/prop2

And on File system say they need to be stored under
/repository/lucene. Then I need a way to map them.

Approach A - Map JCR path to FileSystem path
---------------------------------------------------------------
One simple way would be to recreate the JCR path structure under
/repository/lucene. So path on filesystem would be

/repository/lucene/oak_index/lucene
/repository/lucene/oak_index/prop1
...

Here we would need to do some encoding such that JCR names can be
safely used on filesystem

Approach B - Define a unique name
------------------------------------------------
Here we let user define a unique name for the index and use that. Or
going even further we let user define the path for the index

So which approach to use

For ease of out of the box use I would prefer auto mapping but then
need to be sure if mapping the JCR path to filesystem (only for index
data) would be safe to use?

Chetan Mehrotra

Reply via email to