Top Description Fields Constructors Methods
liquibase.changelog

public Class ChangeLogIterator

extends Object
Class Inheritance
Known Direct Subclasses
liquibase.changelog.StatusChangeLogIterator
Imports
liquibase.*, liquibase.changelog.filter.ChangeSetFilter, .ChangeSetFilterResult, liquibase.changelog.visitor.ChangeSetVisitor, .SkippedChangeSetVisitor, .ValidatingVisitor, liquibase.exception.LiquibaseException, .UnexpectedLiquibaseException, .ValidationErrors, liquibase.executor.Executor, .ExecutorService, liquibase.util.BooleanUtil, .StringUtil, lombok.Getter, java.util.*

The ChangeLogIterator class is responsible for iterating through a list of ChangeSets in a DatabaseChangeLog and executing a visitor for each ChangeSet that passes the specified filters. It provides methods for running the visitor and validating the Executor for each ChangeSet.

Field Summary

Modifier and TypeField and Description
private final Boolean
protected final List<ChangeSetFilter>
private static final ResourceBundle
protected final DatabaseChangeLog
private final List<ChangeSet>
exceptionChangeSets

Changesets which encountered an exception during visit.

private static final String
private final Set<String>
private final List<ChangeSet>
skippedDueToExceptionChangeSets

Changesets that were never visited because a previous changeset encountered an exception.

Constructor Summary

AccessConstructor and Description
public
ChangeLogIterator(DatabaseChangeLog databaseChangeLog, ChangeSetFilter... changeSetFilters)

public
ChangeLogIterator(DatabaseChangeLog databaseChangeLog, List<ChangeSetFilter> changeSetFilters)

public
ChangeLogIterator(List<RanChangeSet> changeSetList, DatabaseChangeLog changeLog, ChangeSetFilter... changeSetFilters)

public
ChangeLogIterator(List<RanChangeSet> changeSetList, DatabaseChangeLog changeLog, List<ChangeSetFilter> changeSetFilters)

Method Summary

Modifier and TypeMethod and Description
private boolean
alreadySaw(ChangeSet changeSet)

By default, this returns false as finalShouldVisit logic has better performance.

protected String
createKey(ChangeSet changeSet)

Creates a unique key to identify this changeset

public List<ChangeSetFilter>
protected void
markSeen(ChangeSet changeSet)

public void
protected void
validateChangeSetExecutor(ChangeSet
The change set to validate
changeSet
,
RuntimeEnvironment
A RuntimeEnvironment instance
env
)

Make sure that any changeset which has a runWith=<executor> setting has a valid Executor, and that the changes in the changeset are eligible for execution by this Executor

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowDuplicatedChangesetsIdentifiersback to summary
private final Boolean allowDuplicatedChangesetsIdentifiers
changeSetFiltersback to summary
protected final List<ChangeSetFilter> changeSetFilters
coreBundleback to summary
private static final ResourceBundle coreBundle
databaseChangeLogback to summary
protected final DatabaseChangeLog databaseChangeLog
exceptionChangeSetsback to summary
private final List<ChangeSet> exceptionChangeSets

Changesets which encountered an exception during visit.

Annotations
@lombok.Getter
MSG_COULD_NOT_FIND_EXECUTORback to summary
private static final String MSG_COULD_NOT_FIND_EXECUTOR
seenChangeSetsback to summary
private final Set<String> seenChangeSets
skippedDueToExceptionChangeSetsback to summary
private final List<ChangeSet> skippedDueToExceptionChangeSets

Changesets that were never visited because a previous changeset encountered an exception.

Annotations
@lombok.Getter

Constructor Detail

ChangeLogIteratorback to summary
public ChangeLogIterator(DatabaseChangeLog databaseChangeLog, ChangeSetFilter... changeSetFilters)
ChangeLogIteratorback to summary
public ChangeLogIterator(DatabaseChangeLog databaseChangeLog, List<ChangeSetFilter> changeSetFilters)
ChangeLogIteratorback to summary
public ChangeLogIterator(List<RanChangeSet> changeSetList, DatabaseChangeLog changeLog, ChangeSetFilter... changeSetFilters)
ChangeLogIteratorback to summary
public ChangeLogIterator(List<RanChangeSet> changeSetList, DatabaseChangeLog changeLog, List<ChangeSetFilter> changeSetFilters)

Method Detail

alreadySawback to summary
private boolean alreadySaw(ChangeSet changeSet)

By default, this returns false as finalShouldVisit logic has better performance. But prior to 4.19.1 the below logic worked, were if a changeset was already saw we would just ignore it instead of throwing an error. This logic was backported under flag ALLOW_DUPLICATED_CHANGESETS_IDENTIFIERS

createKeyback to summary
protected String createKey(ChangeSet changeSet)

Creates a unique key to identify this changeset

getChangeSetFiltersback to summary
public List<ChangeSetFilter> getChangeSetFilters()
markSeenback to summary
protected void markSeen(ChangeSet changeSet)
runback to summary
public void run(ChangeSetVisitor visitor, RuntimeEnvironment env) throws LiquibaseException
validateChangeSetExecutorback to summary
protected void validateChangeSetExecutor(ChangeSet changeSet, RuntimeEnvironment env) throws LiquibaseException

Make sure that any changeset which has a runWith= setting has a valid Executor, and that the changes in the changeset are eligible for execution by this Executor

Parameters
changeSet:ChangeSet

The change set to validate

env:RuntimeEnvironment

A RuntimeEnvironment instance