Class DdlChanges

java.lang.Object
io.debezium.relational.ddl.DdlChanges
All Implemented Interfaces:
DdlParserListener

@NotThreadSafe public class DdlChanges extends Object implements DdlParserListener
A DdlParserListener that accumulates changes, allowing them to be consumed in the same order by database.
Author:
Randall Hauch
  • Field Details

  • Constructor Details

    • DdlChanges

      public DdlChanges()
  • Method Details

    • reset

      public DdlChanges reset()
      Clear all accumulated changes.
      Returns:
      this object for method chaining; never null
    • handle

      public void handle(DdlParserListener.Event event)
      Description copied from interface: DdlParserListener
      Handle a DDL event.
      Specified by:
      handle in interface DdlParserListener
      Parameters:
      event - the DDL event; never null
    • getEventsByDatabase

      public void getEventsByDatabase(DdlChanges.DatabaseEventConsumer consumer)
      Consume the events in the same order they were recorded, but grouped by database name. Multiple sequential statements that were applied to the same database are grouped together.
      Parameters:
      consumer - the consumer
    • getDatabase

      protected String getDatabase(DdlParserListener.Event event)
    • isEmpty

      public boolean isEmpty()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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

        public boolean anyMatch(RelationalTableFilters filters)
        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