You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2012/07/06 14:57:33 UTC
[jira] [Created] (OAK-171) Add NodeState.compareAgainstBaseState()
Jukka Zitting created OAK-171:
---------------------------------
Summary: Add NodeState.compareAgainstBaseState()
Key: OAK-171
URL: https://issues.apache.org/jira/browse/OAK-171
Project: Jackrabbit Oak
Issue Type: Improvement
Components: core
Reporter: Jukka Zitting
Priority: Minor
The {{NodeStore.compare()}} method provides a common mechanism for comparing any two node states, and we originally decided to put the method on the {{NodeStore}} interface instead of on {{NodeState}} as for performance reasons we may want to dispatch the actual diffing operation based on the implementation of either one of the given {{NodeState}} instances.
In practice it turns out that there's an important special case of this operation, comparing a {{NodeState}} against an earlier version of it (i.e. a base state), that is easy to dispatch based on just the modified state and is used so often that keeping the separate {{NodeStore}} reference around for the comparison operation tends to unnecessarily complicate relevant code.
Thus I'd like to introduce a {{NodeState.compareAgainstBaseState()}} method signature in {{oak-core}} for this specific case. We'd still keep the {{NodeStore.compare()}} method around for more complicated diffing cases.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OAK-171) Add
NodeState.compareAgainstBaseState()
Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408006#comment-13408006 ]
Michael Dürig commented on OAK-171:
-----------------------------------
+1
This might also make sense for simplifying the {{ConflictHandler}} of the {{Root.rebase()}} operation.
> Add NodeState.compareAgainstBaseState()
> ---------------------------------------
>
> Key: OAK-171
> URL: https://issues.apache.org/jira/browse/OAK-171
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Jukka Zitting
> Priority: Minor
>
> The {{NodeStore.compare()}} method provides a common mechanism for comparing any two node states, and we originally decided to put the method on the {{NodeStore}} interface instead of on {{NodeState}} as for performance reasons we may want to dispatch the actual diffing operation based on the implementation of either one of the given {{NodeState}} instances.
> In practice it turns out that there's an important special case of this operation, comparing a {{NodeState}} against an earlier version of it (i.e. a base state), that is easy to dispatch based on just the modified state and is used so often that keeping the separate {{NodeStore}} reference around for the comparison operation tends to unnecessarily complicate relevant code.
> Thus I'd like to introduce a {{NodeState.compareAgainstBaseState()}} method signature in {{oak-core}} for this specific case. We'd still keep the {{NodeStore.compare()}} method around for more complicated diffing cases.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (OAK-171) Add NodeState.compareAgainstBaseState()
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting resolved OAK-171.
-------------------------------
Resolution: Fixed
Fix Version/s: 0.4
Assignee: Jukka Zitting
Indeed it looks like we actually won't need the generic compare() method anywhere, so I removed it in revision 1359048.
> Add NodeState.compareAgainstBaseState()
> ---------------------------------------
>
> Key: OAK-171
> URL: https://issues.apache.org/jira/browse/OAK-171
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 0.4
>
>
> The {{NodeStore.compare()}} method provides a common mechanism for comparing any two node states, and we originally decided to put the method on the {{NodeStore}} interface instead of on {{NodeState}} as for performance reasons we may want to dispatch the actual diffing operation based on the implementation of either one of the given {{NodeState}} instances.
> In practice it turns out that there's an important special case of this operation, comparing a {{NodeState}} against an earlier version of it (i.e. a base state), that is easy to dispatch based on just the modified state and is used so often that keeping the separate {{NodeStore}} reference around for the comparison operation tends to unnecessarily complicate relevant code.
> Thus I'd like to introduce a {{NodeState.compareAgainstBaseState()}} method signature in {{oak-core}} for this specific case. We'd still keep the {{NodeStore.compare()}} method around for more complicated diffing cases.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OAK-171) Add
NodeState.compareAgainstBaseState()
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408096#comment-13408096 ]
Jukka Zitting commented on OAK-171:
-----------------------------------
Committed first version in revision 1358282.
bq. how should we handle the case where the base state is not available any more (i.e. OAK-114)?
I think the only reasonable solution there is to throw something like an {{IllegalStateException}}.
> Add NodeState.compareAgainstBaseState()
> ---------------------------------------
>
> Key: OAK-171
> URL: https://issues.apache.org/jira/browse/OAK-171
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Jukka Zitting
> Priority: Minor
>
> The {{NodeStore.compare()}} method provides a common mechanism for comparing any two node states, and we originally decided to put the method on the {{NodeStore}} interface instead of on {{NodeState}} as for performance reasons we may want to dispatch the actual diffing operation based on the implementation of either one of the given {{NodeState}} instances.
> In practice it turns out that there's an important special case of this operation, comparing a {{NodeState}} against an earlier version of it (i.e. a base state), that is easy to dispatch based on just the modified state and is used so often that keeping the separate {{NodeStore}} reference around for the comparison operation tends to unnecessarily complicate relevant code.
> Thus I'd like to introduce a {{NodeState.compareAgainstBaseState()}} method signature in {{oak-core}} for this specific case. We'd still keep the {{NodeStore.compare()}} method around for more complicated diffing cases.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OAK-171) Add
NodeState.compareAgainstBaseState()
Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408389#comment-13408389 ]
Michael Dürig commented on OAK-171:
-----------------------------------
In revision 1358443 I replaced more usage of {{NodeStore.compare()}} with {{NodeState.compareAgainstBaseState()}} which simplifies the code quite a bit. {{NodeStore.compare()}} is not used any more now and we might even want to consider removing it.
> Add NodeState.compareAgainstBaseState()
> ---------------------------------------
>
> Key: OAK-171
> URL: https://issues.apache.org/jira/browse/OAK-171
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Jukka Zitting
> Priority: Minor
>
> The {{NodeStore.compare()}} method provides a common mechanism for comparing any two node states, and we originally decided to put the method on the {{NodeStore}} interface instead of on {{NodeState}} as for performance reasons we may want to dispatch the actual diffing operation based on the implementation of either one of the given {{NodeState}} instances.
> In practice it turns out that there's an important special case of this operation, comparing a {{NodeState}} against an earlier version of it (i.e. a base state), that is easy to dispatch based on just the modified state and is used so often that keeping the separate {{NodeStore}} reference around for the comparison operation tends to unnecessarily complicate relevant code.
> Thus I'd like to introduce a {{NodeState.compareAgainstBaseState()}} method signature in {{oak-core}} for this specific case. We'd still keep the {{NodeStore.compare()}} method around for more complicated diffing cases.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OAK-171) Add
NodeState.compareAgainstBaseState()
Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408008#comment-13408008 ]
Michael Dürig commented on OAK-171:
-----------------------------------
On a related note: how should we handle the case where the base state is not available any more (i.e. OAK-114)?
> Add NodeState.compareAgainstBaseState()
> ---------------------------------------
>
> Key: OAK-171
> URL: https://issues.apache.org/jira/browse/OAK-171
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Jukka Zitting
> Priority: Minor
>
> The {{NodeStore.compare()}} method provides a common mechanism for comparing any two node states, and we originally decided to put the method on the {{NodeStore}} interface instead of on {{NodeState}} as for performance reasons we may want to dispatch the actual diffing operation based on the implementation of either one of the given {{NodeState}} instances.
> In practice it turns out that there's an important special case of this operation, comparing a {{NodeState}} against an earlier version of it (i.e. a base state), that is easy to dispatch based on just the modified state and is used so often that keeping the separate {{NodeStore}} reference around for the comparison operation tends to unnecessarily complicate relevant code.
> Thus I'd like to introduce a {{NodeState.compareAgainstBaseState()}} method signature in {{oak-core}} for this specific case. We'd still keep the {{NodeStore.compare()}} method around for more complicated diffing cases.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira