Class FastCheckService

java.lang.Object
liquibase.changelog.FastCheckService
All Implemented Interfaces:
SingletonObject

public class FastCheckService extends Object implements SingletonObject
Service to perform a fast check of the historyService to determine if there is no unrun changesets without obtaining an exclusive write lock.
  • Method Details

    • isUpToDateFastCheck

      public boolean isUpToDateFastCheck(List<ChangeSetFilter> changesetFilters, Database database, DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labelExpression) throws LiquibaseException
      Performs check of the historyService to determine if there is no unrun changesets without obtaining an exclusive write lock. This allows multiple peer services to boot in parallel in the common case where there are no changelogs to run.

      If we see that there is nothing in the changelog to run and this returns true, then regardless of the lock status we already know we are "done" and can finish up without waiting for the lock.

      But, if there are changelogs that might have to be ran and this returns false, you MUST get a lock and do a real check to know what changesets actually need to run.

      NOTE: to reduce the number of queries to the databasehistory table, this method will cache the "fast check" results within this instance under the assumption that the total changesets will not change within this instance.

      Throws:
      LiquibaseException
    • clearCache

      public void clearCache()
      Clear fastCheck cache