Class BatchUpdate

  • All Implemented Interfaces:
    AutoCloseable

    public class BatchUpdate
    extends Object
    implements AutoCloseable
    Helper for a set of change updates that should be applied to the NoteDb database.

    An update operation can be divided into three phases:

    1. Git reference updates
    2. Review metadata updates
    3. Post-update steps
    A single conceptual operation, such as a REST API call or a merge operation, may make multiple changes at each step, which all need to be serialized relative to each other. Moreover, for consistency, the git ref updates must be visible to the review metadata updates, since for example the metadata might refer to newly-created patch set refs. In NoteDb, this is accomplished by combining these two phases into a single BatchRefUpdate.

    Similarly, all post-update steps, such as sending email, must run only after all storage mutations have completed.