Marcel Reutegger created OAK-2120:
-------------------------------------
Summary: Simplify BranchStates
Key: OAK-2120
URL: https://issues.apache.org/jira/browse/OAK-2120
Project: Jackrabbit Oak
Issue Type: Improvement
Components: core
Reporter: Marcel Reutegger
Assignee: Marcel Reutegger
Priority: Minor
Transitions between the various BranchStates are documented for each of the
state classes in AbstractNodeStoreBranch. I'd like to simplify some of the
states and remove transitions that can be expensive.
E.g. Persisted.setRoot() may transition to Unmodified if the given root state
equals the base state. This makes sense, but is unlikely to happen on a real
life system. At least with the DocumentNodeStore the equals comparison of base
and root in setRoot() can become rather expensive if there had been many branch
commits already.
I propose to remove the transition back to Unmodified. I don't see a compelling
reason or requirement to perform this check at this stage. The branch could
simply stay in the Persisted state and leave it up to the underlying NodeStore
implementation to optimize the case where subsequent branch commits 'undo'
previous changes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)