Class AbstractDatabaseHistory

    • Constructor Detail

      • AbstractDatabaseHistory

        protected AbstractDatabaseHistory()
    • Method Detail

      • configure

        public void configure​(Configuration config,
                              HistoryRecordComparator comparator,
                              DatabaseHistoryListener listener,
                              boolean useCatalogBeforeSchema)
        Description copied from interface: DatabaseHistory
        Configure this instance.
        Specified by:
        configure in interface DatabaseHistory
        Parameters:
        config - the configuration for this history store
        comparator - the function that should be used to compare history records during recovery; may be null if the default comparator is to be used
        listener - TODO
        useCatalogBeforeSchema - true if the parsed string for a table contains only 2 items and the first should be used as the catalog and the second as the table name, or false if the first should be used as the schema and the second as the table name
      • record

        public final void record​(Map<String,​?> source,
                                 Map<String,​?> position,
                                 String databaseName,
                                 String ddl)
                          throws DatabaseHistoryException
        Description copied from interface: DatabaseHistory
        Record a change to the schema of the named database, and store it in the schema storage.
        Specified by:
        record in interface DatabaseHistory
        Parameters:
        source - the information about the source database; may not be null
        position - the point in history where these DDL changes were made, which may be used when recovering the schema to some point in history; may not be null
        databaseName - the name of the database whose schema is being changed; may be null
        ddl - the DDL statements that describe the changes to the database schema; may not be null
        Throws:
        DatabaseHistoryException - if the record could not be written
      • recover

        public final void recover​(Map<String,​?> source,
                                  Map<String,​?> position,
                                  Tables schema,
                                  DdlParser ddlParser)
        Description copied from interface: DatabaseHistory
        Recover the database schema to a known point in its history. Note that it is possible to recover the database schema to a point in history that is earlier than what has been recorded. Likewise, when recovering to a point in history later than what was recorded, the database schema will reflect the latest state known to the history.
        Specified by:
        recover in interface DatabaseHistory
        Parameters:
        source - the information about the source database; may not be null
        position - the point in history at which the database schema should be recovered; may not be null
        schema - the table definitions that should be changed to reflect the database schema at the desired point in history; may not be null
        ddlParser - the DDL parser that can be used to apply DDL statements to the given schema; may not be null
      • stop

        public void stop()
        Description copied from interface: DatabaseHistory
        Stop recording history and release any resources acquired since #configure(Configuration, HistoryRecordComparator, DatabaseHistoryListener).
        Specified by:
        stop in interface DatabaseHistory