Class QueryInformationSchemaMetadata

java.lang.Object
io.debezium.connector.postgresql.transforms.timescaledb.AbstractTimescaleDbMetadata
io.debezium.connector.postgresql.transforms.timescaledb.QueryInformationSchemaMetadata
All Implemented Interfaces:
TimescaleDbMetadata, Closeable, AutoCloseable

public class QueryInformationSchemaMetadata extends AbstractTimescaleDbMetadata
TimescaleDB metadata registry that performs out-of-band queries of TimescaleDB catalog to get the mappings between chunks, hypertables and aggregates.
Author:
Jiri Pechanec
  • Field Details

    • CATALOG_SCHEMA

      private static final String CATALOG_SCHEMA
      See Also:
    • QUERY_HYPERTABLE_TO_AGGREGATE

      private static final String QUERY_HYPERTABLE_TO_AGGREGATE
    • QUERY_CHUNK_TO_HYPERTABLE

      private static final String QUERY_CHUNK_TO_HYPERTABLE
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • connection

      private final PostgresConnection connection
    • chunkToHypertable

      private final Map<TableId,TableId> chunkToHypertable
    • hypertableToAggregate

      private final Map<TableId,TableId> hypertableToAggregate
  • Constructor Details

    • QueryInformationSchemaMetadata

      public QueryInformationSchemaMetadata(Configuration config)
  • Method Details

    • hypertableId

      public Optional<TableId> hypertableId(TableId chunkId)
      Description copied from interface: TimescaleDbMetadata
      Returns the TableId to which given chunk belong. Empty if this is not TimescaleDB chunk identifier. Resolution if the identifier is chunk or not is based on a preconfigured list of schemas.
    • aggregateId

      public Optional<TableId> aggregateId(TableId hypertableId)
      Description copied from interface: TimescaleDbMetadata
      Returns the TableId that represents continuous aggregate view for which the hypertable is backend. Empty if hypertable is not associated with a continuous aggregate view.
    • close

      public void close() throws IOException
      Throws:
      IOException
    • loadTimescaleMetadata

      private void loadTimescaleMetadata()