Package io.debezium.converters.spi
Class RecordParser
java.lang.Object
io.debezium.converters.spi.RecordParser
An abstract parser of change records. Fields and metadata of change records can be provided by RecordParser.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final org.apache.kafka.connect.data.Schemaprivate final Stringprivate final Stringprivate final org.apache.kafka.connect.data.Schemaprivate final org.apache.kafka.connect.data.Structprivate final org.apache.kafka.connect.data.Structprivate final org.apache.kafka.connect.data.Structprivate final Stringprivate final org.apache.kafka.connect.data.Schemaprivate final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRecordParser(RecordAndMetadata recordAndMetadata, String... dataFields) -
Method Summary
Modifier and TypeMethodDescriptionGet the type of the connector which produced this record .org.apache.kafka.connect.data.Structdata()Get the value of the data field in the record; may not be null.org.apache.kafka.connect.data.SchemaGet the schema of the data field in the record; may be not be null.abstract ObjectgetMetadata(String name) 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.SchemaopSchema()Get the schema of the op field in the record.org.apache.kafka.connect.data.Structsource()Get the value of the source field in the record.org.apache.kafka.connect.data.StructGet the value of the transaction field in the record.ts_ms()Get the value of the ts_ms field in the record.org.apache.kafka.connect.data.SchemaGet the schema of the ts_ms field in the record.type()Get type of a message .
-
Field Details
-
record
private final org.apache.kafka.connect.data.Struct record -
id
-
type
-
source
private final org.apache.kafka.connect.data.Struct source -
transaction
private final org.apache.kafka.connect.data.Struct transaction -
op
-
opSchema
private final org.apache.kafka.connect.data.Schema opSchema -
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
-
SOURCE_FIELDS
-
-
Constructor Details
-
RecordParser
-
-
Method Details
-
id
Get id of a message .- Returns:
- id of a message
-
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
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
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. -
data
public org.apache.kafka.connect.data.Struct data()Get the value of the data field in the record; may not be null. -
connectorType
Get the type of the connector which produced this record .- Returns:
- the connector type
-
getMetadata
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
-