Class MemoryDb

    • Method Detail

      • newInstance

        public static MemoryDb newInstance()
        Creates a new empty MemoryDb.
      • createSnapshot

        public Snapshot createSnapshot​(Cleaner cleaner)
        Description copied from interface: Database
        Creates a new snapshot of the database state.
        Specified by:
        createSnapshot in interface Database
        Parameters:
        cleaner - a cleaner to register the snapshot
        Returns:
        a new snapshot of the database state
      • createFork

        public Fork createFork​(Cleaner cleaner)
        Description copied from interface: Database
        Creates a new database fork.

        A fork allows to perform a transaction: a number of independent writes to a database, which then may be atomically applied to the database.

        Specified by:
        createFork in interface Database
        Parameters:
        cleaner - a cleaner to register the fork
        Returns:
        a new database fork
      • merge

        public void merge​(Fork fork)
        Applies the changes from the given fork to the database state.
        Parameters:
        fork - a fork to get changes from