Class TimescaleDb<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>

java.lang.Object
io.debezium.connector.postgresql.transforms.timescaledb.TimescaleDb<R>
Type Parameters:
R -
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.kafka.common.Configurable, org.apache.kafka.connect.components.Versioned, org.apache.kafka.connect.transforms.Transformation<R>

public class TimescaleDb<R extends org.apache.kafka.connect.connector.ConnectRecord<R>> extends Object implements org.apache.kafka.connect.transforms.Transformation<R>, org.apache.kafka.connect.components.Versioned
Single message transform that modifies records coming from TimescaleDB. It operates on chunks and aggregate's materialized hypertables.
  • chunk source info block and topic name is replaced with appropriate hypertable name
  • chunks belonging to hypertables acting as materialized aggregates have topic name and source info block updated with aggregate name
  • headers are added with original chunk schema/table name and for aggregates with original materialized hypertable schema/table name
Author:
Jiri Pechanec
  • Field Details

  • Constructor Details

    • TimescaleDb

      public TimescaleDb()
  • Method Details

    • configure

      public void configure(Map<String,?> configs)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable
    • apply

      public R apply(R record)
      Specified by:
      apply in interface org.apache.kafka.connect.transforms.Transformation<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
    • getNewTopicName

      private String getNewTopicName(TableId newId)
    • addHeaders

      private org.apache.kafka.connect.header.Headers addHeaders(org.apache.kafka.connect.header.Headers headers, TableId chunkId, TableId hypertableId, Optional<TableId> aggregateId)
    • config

      public org.apache.kafka.common.config.ConfigDef config()
      Specified by:
      config in interface org.apache.kafka.connect.transforms.Transformation<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.kafka.connect.transforms.Transformation<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
    • version

      public String version()
      Specified by:
      version in interface org.apache.kafka.connect.components.Versioned
    • setMetadata

      @VisibleForTesting void setMetadata(TimescaleDbMetadata metadata)