Package io.debezium.relational.ddl
Class DdlChanges
java.lang.Object
io.debezium.relational.ddl.DdlChanges
- All Implemented Interfaces:
DdlParserListener
A
DdlParserListener that accumulates changes, allowing them to be consumed in the same order by database.- Author:
- Randall Hauch
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfaceNested classes/interfaces inherited from interface io.debezium.relational.ddl.DdlParserListener
DdlParserListener.DatabaseAlteredEvent, DdlParserListener.DatabaseCreatedEvent, DdlParserListener.DatabaseDroppedEvent, DdlParserListener.DatabaseEvent, DdlParserListener.DatabaseSwitchedEvent, DdlParserListener.Event, DdlParserListener.EventType, DdlParserListener.SetVariableEvent, DdlParserListener.TableAlteredEvent, DdlParserListener.TableCreatedEvent, DdlParserListener.TableDroppedEvent, DdlParserListener.TableEvent, DdlParserListener.TableIndexCreatedEvent, DdlParserListener.TableIndexDroppedEvent, DdlParserListener.TableIndexEvent, DdlParserListener.TableTruncatedEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<DdlParserListener.Event>private final String -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new changes object with ';' as the terminator token.DdlChanges(String terminator) Create a new changes object with the designated terminator token. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddTable(Set<TableId> tables, DdlParserListener.Event event) booleananyMatch(RelationalTableFilters filters) booleanDeprecated.booleanprotected StringvoidConsume the events in the same order they wererecorded, but grouped by database name.voidConsume the events in the same order they wererecorded, but grouped by database name.voidConsume the events in the same order they wererecorded, but grouped by database name.voidConsume the events in the same order they wererecorded, but grouped by database name.voidhandle(DdlParserListener.Event event) Handle a DDL event.booleanisEmpty()reset()Clear all accumulated changes.toString()
-
Field Details
-
terminator
-
events
-
databaseNames
-
-
Constructor Details
-
DdlChanges
public DdlChanges()Create a new changes object with ';' as the terminator token. -
DdlChanges
Create a new changes object with the designated terminator token.- Parameters:
terminator- the token used to terminate each statement; may be null
-
-
Method Details
-
reset
Clear all accumulated changes.- Returns:
- this object for method chaining; never null
-
handle
Description copied from interface:DdlParserListenerHandle a DDL event.- Specified by:
handlein interfaceDdlParserListener- Parameters:
event- the DDL event; never null
-
groupStatementStringsByDatabase
Consume the events in the same order they wererecorded, but grouped by database name. Multiple sequential statements that were applied to the same database are grouped together.- Parameters:
consumer- the consumer
-
addTable
-
groupStatementsByDatabase
Consume the events in the same order they wererecorded, but grouped by database name. Multiple sequential statements that were applied to the same database are grouped together.- Parameters:
consumer- the consumer
-
groupEventsByDatabase
Consume the events in the same order they wererecorded, but grouped by database name. Multiple sequential statements that were applied to the same database are grouped together.- Parameters:
consumer- the consumer
-
getEventsByDatabase
Consume the events in the same order they wererecorded, but grouped by database name. Multiple sequential statements that were applied to the same database are grouped together.- Parameters:
consumer- the consumer
-
getDatabase
-
isEmpty
public boolean isEmpty() -
applyToMoreDatabasesThan
-
toString
-
anyMatch
@Deprecated public boolean anyMatch(Predicate<String> databaseFilter, Predicate<TableId> tableFilter) Deprecated.- Returns:
- true if any event stored is one of
- database-wide events and affects included/excluded database
- table related events and the table is included
- events that set a variable and either affects included database or is a system-wide variable
-
anyMatch
- Returns:
- true if any event stored is one of
- database-wide events and affects included/excluded database
- table related events and the table is included
- events that set a variable and either affects included database or is a system-wide variable
-