Class RecordParser

java.lang.Object
io.debezium.converters.spi.RecordParser

public abstract class RecordParser extends Object
An abstract parser of change records. Fields and metadata of change records can be provided by RecordParser.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
     
    private final org.apache.kafka.connect.data.Schema
     
    private final String
     
    private final String
     
    private final org.apache.kafka.connect.data.Schema
     
    private final org.apache.kafka.connect.data.Struct
     
    private final org.apache.kafka.connect.data.Struct
     
    protected static final Set<String>
     
    private final org.apache.kafka.connect.data.Struct
     
    private final String
     
    private final org.apache.kafka.connect.data.Schema
     
    private final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    RecordParser(RecordAndMetadata recordAndMetadata, String... dataFields)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the type of the connector which produced this record .
    org.apache.kafka.connect.data.Struct
    Get the value of the data field in the record; may not be null.
    org.apache.kafka.connect.data.Schema
    Get the schema of the data field in the record; may be not be null.
    abstract Object
    Search for metadata of the record by name, which are defined in the source field; throw a DataException if not found.
    id()
    Get id of a message .
    op()
    Get the value of the op field in the record.
    org.apache.kafka.connect.data.Schema
    Get the schema of the op field in the record.
    org.apache.kafka.connect.data.Struct
    Get the value of the source field in the record.
    org.apache.kafka.connect.data.Struct
    Get the value of the transaction field in the record.
    Get the value of the ts_ms field in the record.
    org.apache.kafka.connect.data.Schema
    Get the schema of the ts_ms field in the record.
    Get type of a message .

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • record

      private final org.apache.kafka.connect.data.Struct record
    • id

      private final String id
    • type

      private final String type
    • source

      private final org.apache.kafka.connect.data.Struct source
    • transaction

      private final org.apache.kafka.connect.data.Struct transaction
    • op

      private final String op
    • opSchema

      private final org.apache.kafka.connect.data.Schema opSchema
    • ts_ms

      private final String ts_ms
    • ts_msSchema

      private final org.apache.kafka.connect.data.Schema ts_msSchema
    • dataSchema

      private final org.apache.kafka.connect.data.Schema dataSchema
    • connectorType

      private final String connectorType
    • SOURCE_FIELDS

      protected static final Set<String> SOURCE_FIELDS
  • Constructor Details

  • Method Details

    • data

      public org.apache.kafka.connect.data.Struct data()
      Get the value of the data field in the record; may not be null.
    • id

      public String id()
      Get id of a message .
      Returns:
      id of a message
    • type

      public String type()
      Get type of a message .
      Returns:
      type of a message
    • source

      public org.apache.kafka.connect.data.Struct source()
      Get the value of the source field in the record.
      Returns:
      the value of the source field
    • transaction

      public org.apache.kafka.connect.data.Struct transaction()
      Get the value of the transaction field in the record.
      Returns:
      the value of the transaction field
    • op

      public String op()
      Get the value of the op field in the record.
      Returns:
      the value of the op field
    • opSchema

      public org.apache.kafka.connect.data.Schema opSchema()
      Get the schema of the op field in the record.
      Returns:
      the schema of the op field
    • ts_ms

      public String ts_ms()
      Get the value of the ts_ms field in the record.
      Returns:
      the value of the ts_ms field
    • ts_msSchema

      public org.apache.kafka.connect.data.Schema ts_msSchema()
      Get the schema of the ts_ms field in the record.
      Returns:
      the schema of the ts_ms field
    • dataSchema

      public org.apache.kafka.connect.data.Schema dataSchema()
      Get the schema of the data field in the record; may be not be null.
    • connectorType

      public String connectorType()
      Get the type of the connector which produced this record .
      Returns:
      the connector type
    • getMetadata

      public abstract Object getMetadata(String name)
      Search for metadata of the record by name, which are defined in the source field; throw a DataException if not found.
      Returns:
      metadata of the record