Class MutableNotesMigration


  • public class MutableNotesMigration
    extends NotesMigration
    NotesMigration with additional methods for altering the migration state at runtime.

    Almost all callers care only about inspecting the migration state, and for safety should not have access to mutation methods, which must be used with extreme care. Those callers should inject NotesMigration.

    Some callers, namely the NoteDb migration pipeline and tests, do need to alter the migration state at runtime, and those callers are expected to take the necessary precautions such as keeping the in-memory and on-disk config state in sync. Those callers use this class.

    Mutations to the MutableNotesMigration are guaranteed to be instantly visible to all callers that use the non-mutable NotesMigration. The current implementation accomplishes this by always binding NotesMigration to MutableNotesMigration in Guice, so there is just one NotesMigration instance process-wide.