Class RelationalDatabaseSchema

java.lang.Object
io.debezium.relational.RelationalDatabaseSchema
All Implemented Interfaces:
DatabaseSchema<TableId>, AutoCloseable
Direct Known Subclasses:
HistorizedRelationalDatabaseSchema

public abstract class RelationalDatabaseSchema extends Object implements DatabaseSchema<TableId>
A DatabaseSchema of a relational database such as Postgres. Provides information about the physical structure of the database (the "database schema") as well as the structure of corresponding CDC messages (the "event schema").
Author:
Gunnar Morling
  • Field Details

  • Constructor Details

  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • tableIds

      public Set<TableId> tableIds()
      Returns the set of table ids included in the current filter configuration.
    • assureNonEmptySchema

      public void assureNonEmptySchema()
      Specified by:
      assureNonEmptySchema in interface DatabaseSchema<TableId>
    • schemaFor

      public TableSchema schemaFor(TableId id)
      Get the Schema information for the table with the given identifier, if that table exists and is included by the filter configuration.

      Note that the Schema will not contain any columns that have been filtered out.

      Specified by:
      schemaFor in interface DatabaseSchema<TableId>
      Parameters:
      id - the table identifier; may be null
      Returns:
      the schema information, or null if there is no table with the given identifier, if the identifier is null, or if the table has been excluded by the filters
    • tableFor

      public Table tableFor(TableId id)
      Get the Table meta-data for the table with the given identifier, if that table exists and is included by the filter configuration
      Parameters:
      id - the table identifier; may be null
      Returns:
      the current table definition, or null if there is no table with the given identifier, if the identifier is null, or if the table has been excluded by the filters
    • isHistorized

      public boolean isHistorized()
      Description copied from interface: DatabaseSchema
      Whether this schema is historized (i.e. a history of all schema changes is kept which is recovered upon connector restart) or not.
      Specified by:
      isHistorized in interface DatabaseSchema<TableId>
    • tables

      protected Tables tables()
    • clearSchemas

      protected void clearSchemas()
    • buildAndRegisterSchema

      protected void buildAndRegisterSchema(Table table)
      Builds up the CDC event schema for the given table and stores it in this schema.
    • removeSchema

      protected void removeSchema(TableId id)
    • getTableFilter

      protected Tables.TableFilter getTableFilter()
    • tableInformationComplete

      public boolean tableInformationComplete()
      Description copied from interface: DatabaseSchema
      Indicates whether or not table names are guaranteed to be fully present, regardless of whether or not a snapshot has been performed.
      Specified by:
      tableInformationComplete in interface DatabaseSchema<TableId>
      Returns:
      boolean indicating if table names are present
    • refresh

      public void refresh(Table table)
      Refreshes the schema content with a table constructed externally
      Parameters:
      table - constructed externally - typically from decoder metadata or an external signal
    • refreshSchema

      protected void refreshSchema(TableId id)