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

java.lang.Object
io.debezium.transforms.AbstractExtractNewRecordState<R>
io.debezium.transforms.ExtractNewRecordState<R>
Type Parameters:
R - the subtype of ConnectRecord on which this transformation will operate
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.kafka.common.Configurable, org.apache.kafka.connect.transforms.Transformation<R>

public class ExtractNewRecordState<R extends org.apache.kafka.connect.connector.ConnectRecord<R>> extends AbstractExtractNewRecordState<R>
Debezium generates CDC (Envelope) records that are struct of values containing values before and after change. Sink connectors usually are not able to work with a complex structure so a user use this SMT to extract after value and send it down unwrapped in Envelope.

The functionality is similar to ExtractField SMT but has a special semantics for handling delete events; when delete event is emitted by database then Debezium emits two messages: a delete message and a tombstone message that serves as a signal to Kafka compaction process.

The SMT by default drops the tombstone message created by Debezium and converts the delete message into a tombstone message that can be dropped, too, if required.

The SMT also has the option to insert fields from the original record (e.g. 'op' or 'source.ts_ms') into the unwrapped record or add them as header attributes.

Author:
Jiri Pechanec
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • EXCLUDE

      private static final String EXCLUDE
      See Also:
    • SCHEMA_CACHE_SIZE

      private static final int SCHEMA_CACHE_SIZE
      See Also:
    • DROP_FIELDS_HEADER

      private static final Field DROP_FIELDS_HEADER
    • DROP_FIELDS_FROM_KEY

      private static final Field DROP_FIELDS_FROM_KEY
    • DROP_FIELDS_KEEP_SCHEMA_COMPATIBLE

      private static final Field DROP_FIELDS_KEEP_SCHEMA_COMPATIBLE
    • dropFieldsHeaderName

      private String dropFieldsHeaderName
    • dropFieldsFromKey

      private boolean dropFieldsFromKey
    • dropFieldsKeepSchemaCompatible

      private boolean dropFieldsKeepSchemaCompatible
    • schemaUpdateCache

      private BoundedConcurrentHashMap<AbstractExtractNewRecordState.NewRecordValueMetadata,org.apache.kafka.connect.data.Schema> schemaUpdateCache
    • configFields

      private final Field.Set configFields
  • Constructor Details

    • ExtractNewRecordState

      public ExtractNewRecordState()
  • Method Details