Class DefaultCollectionNamingStrategy

java.lang.Object
io.debezium.sink.naming.DefaultCollectionNamingStrategy
All Implemented Interfaces:
CollectionNamingStrategy

public class DefaultCollectionNamingStrategy extends Object implements CollectionNamingStrategy
Default implementation of the CollectionNamingStrategy where the table name is driven directly from the topic name, replacing any dot characters with underscore and source field in topic.
Author:
Chris Cranford, rk3rn3r
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • ENVELOPE_SOURCE_FIELD_NAME

      private static final String ENVELOPE_SOURCE_FIELD_NAME
      See Also:
    • sourcePattern

      private final Pattern sourcePattern
  • Constructor Details

    • DefaultCollectionNamingStrategy

      public DefaultCollectionNamingStrategy()
  • Method Details

    • resolveCollectionName

      public String resolveCollectionName(DebeziumSinkRecord record, String collectionNameFormat)
      Description copied from interface: CollectionNamingStrategy
      Resolves the logical collection name from the Debezium sink record.
      Specified by:
      resolveCollectionName in interface CollectionNamingStrategy
      Parameters:
      record - Debezium sink record, should not be null
      collectionNameFormat - the format string for the collection name (mapped from the topic name)
      Returns:
      the resolved logical collection name; if null the record should not be processed
    • resolveCollectionNameBySource

      private String resolveCollectionNameBySource(DebeziumSinkRecord record, String collectionName, String collectionNameFormat)