Hi Robert,

On 26.10.16 11:28 , Robert Munteanu wrote:
On Wed, 2016-10-05 at 12:13 +0300, Robert Munteanu wrote:

Created a sub-task for this

   OAK-4891 - Mount-time sanity checks for mounted NodeStore
instances
   https://issues.apache.org/jira/browse/OAK-4891

I've thought about this a little more. When mounting a NodeStore we are
working (unsurprisingly) at the NodeStore level, so we don't have any
concept of node types, versions, etc. So I can't use any of the logic
from oak-jcr, like the VersionManagerImpl.

This kind of logic is implemented in the various commit hooks. See e.g. {{org.apache.jackrabbit.oak.plugins.version.VersionHook}}. The sanity checks should reuse these hooks.


The only way that I see right now is to use the NodeStore API and
'manually' perform the needed checks, e.g. look for nodes with a
property named 'jcr:mixinTypes' which has a 'mix:referenceable' value.

Please don't. We need to stay DRY here. Everything else will fall apart going forward.


Is this approach a viable one? Also, is this done somewhere else in the
Oak codebase? I'd like to avoid duplication.

The intention of the commit hook was to make them pluggable. Have a look at the Jcr and Oak builder classes and how we actually inject those hooks to implement the JCR semantics. The sanity checks should follow a similar approach IMO.

Michael


Thanks,

Robert

Reply via email to