[ 
https://issues.apache.org/jira/browse/OAK-1838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14001736#comment-14001736
 ] 

Michael Dürig commented on OAK-1838:
------------------------------------

In a F2F discussion with [~jukkaz] and [~mreutegg] we came up with two 
approaches for trying to address this:

1. Introduce a commit hook that directly takes a node builder so the extra 
acquisition from within the commit hook would not be necessary. In cases where 
such a extra acquisition would still take place we could just return a 
{{MemoryNodeBuilder}} and document the limitations (i.e. those changes would be 
limited by heap size). 

2. Implement cloning of a branch within document node store: when a branch of a 
branch would be required the document node store would just clone the existing 
branch. As the by far most common case only creates a linear structure (i.e. 
there will be never more that one node builder acquired from any single node 
state), we could try to optimise the cloning for this case. For the other case 
we could just return a {{MemoryNodeBuilder}} and document the limitations (i.e. 
those changes would be limited by heap size). 

I think it would sense to follow up on both approaches initially and compare 
results at some point before we decide no a certain approach.

> NodeStore API: divergence in contract and implementations
> ---------------------------------------------------------
>
>                 Key: OAK-1838
>                 URL: https://issues.apache.org/jira/browse/OAK-1838
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>            Reporter: Michael Dürig
>
> Currently there is a gap between what the API mandates and what the document 
> and kernel node stores implement. This hinders further evolution of the Oak 
> stack as implementers must always be aware of non explicit design 
> requirements. We should look into ways we could close this gap by bringing 
> implementation and specification closer towards each other. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to