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

Generalise Root.commit(String) to Root.commit(Map)

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.17
    • Component/s: core
    • Labels:
      None

      Description

      Currently Root.commit takes a message argument of type string. This is used in a single place for looping through the user data for observation, which stretches the initial intention. OTOH we might need a way to convey additional information from Root.commit to the commit validators (e.g. for OAK-1424). I therefore suggest to replace the message parameter with a info parameter of type Map<String, Object>:

          /**
           * Atomically persists all changes made to the tree attached to this root.
           * <p>
           * If {@code info} contains a mapping for {@link #COMMIT_PATH} and the
           * associated value is a string, implementations may throw a
           * {@code CommitFailedException} if there are changes outside of the subtree
           * designated by that path and the implementation does not support
           * such partial commits. However all implementation must handler the
           * case where a {@code path} designates a subtree that contains all
           * unpersisted changes.
           * <p>
           * The {@code info} map is passed to the underlying storage
           * as a part of the internal commit information attached to this commit.
           * The commit information will be made available to local observers but
           * will not be visible to observers on other cluster nodes.
           * <p>
           * After a successful operation the root is automatically
           * {@link #refresh() refreshed}, such that trees previously obtained
           * through {@link #getTree(String)} may become non existing.
           */
          void commit(Map<String, Object> info) throws CommitFailedException;
      

        Attachments

          Activity

            People

            • Assignee:
              mduerig Michael Dürig
              Reporter:
              mduerig Michael Dürig

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment