Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-2120

Simplify BranchStates

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0.7, 1.1.0
    • core
    • None

    Description

      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.

      Attachments

        Activity

          People

            mreutegg Marcel Reutegger
            mreutegg Marcel Reutegger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: