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
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
Nested 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
Modifier and TypeFieldDescriptionprivate final List<DdlParserListener.Event>
private final String
-
Constructor Summary
ConstructorDescriptionCreate 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 void
addTable
(Set<TableId> tables, DdlParserListener.Event event) boolean
anyMatch
(RelationalTableFilters filters) boolean
Deprecated.boolean
protected String
void
Consume the events in the same order they wererecorded
, but grouped by database name.void
Consume the events in the same order they wererecorded
, but grouped by database name.void
Consume the events in the same order they wererecorded
, but grouped by database name.void
Consume the events in the same order they wererecorded
, but grouped by database name.void
handle
(DdlParserListener.Event event) Handle a DDL event.boolean
isEmpty()
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:DdlParserListener
Handle a DDL event.- Specified by:
handle
in 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
-