public abstract class RecordParser extends Object
create a concrete parser for a record
and the parser's type is chosen by the connector type (e.g. mysql, postgresql, etc.) defined in change records.
Fields and metadata of change records can be provided by RecordParser.| Modifier and Type | Class and Description |
|---|---|
static class |
RecordParser.MongodbRecordParser
Parser for records produced by MongoDB connectors.
|
static class |
RecordParser.MysqlRecordParser
Parser for records produced by MySQL connectors.
|
static class |
RecordParser.PostgresRecordParser
Parser for records produced by PostgreSQL connectors.
|
static class |
RecordParser.SqlserverRecordParser
Parser for records produced by Sql Server connectors.
|
| Modifier and Type | Field and Description |
|---|---|
private String |
connectorType |
private org.apache.kafka.connect.data.Schema |
dataSchema |
private String |
op |
private org.apache.kafka.connect.data.Schema |
opSchema |
private org.apache.kafka.connect.data.Struct |
record |
private org.apache.kafka.connect.data.Struct |
source |
(package private) static Set<String> |
SOURCE_FIELDS |
private org.apache.kafka.connect.data.Struct |
transaction |
private String |
ts_ms |
private org.apache.kafka.connect.data.Schema |
ts_msSchema |
| Modifier | Constructor and Description |
|---|---|
protected |
RecordParser(org.apache.kafka.connect.data.Schema schema,
org.apache.kafka.connect.data.Struct record,
String... dataFields) |
| Modifier and Type | Method and Description |
|---|---|
String |
connectorType()
Get the type of the connector which produced this record
.
|
static RecordParser |
create(org.apache.kafka.connect.data.Schema schema,
Object value)
Create a concrete parser of a change record for a specific connector type.
|
org.apache.kafka.connect.data.Struct |
data()
Get the value of the data field in the record; may not be null.
|
org.apache.kafka.connect.data.Schema |
dataSchema()
Get the schema of the data field in the record; may be not be null.
|
private static org.apache.kafka.connect.data.Schema |
getDataSchema(org.apache.kafka.connect.data.Schema schema,
String connectorType,
String... fields) |
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.
|
String |
op()
Get the value of the op field in the record.
|
org.apache.kafka.connect.data.Schema |
opSchema()
Get the schema of the op field in the record.
|
org.apache.kafka.connect.data.Struct |
source()
Get the value of the source field in the record.
|
org.apache.kafka.connect.data.Struct |
transaction()
Get the value of the transaction field in the record.
|
String |
ts_ms()
Get the value of the ts_ms field in the record.
|
org.apache.kafka.connect.data.Schema |
ts_msSchema()
Get the schema of the ts_ms field in the record.
|
private final org.apache.kafka.connect.data.Struct record
private final org.apache.kafka.connect.data.Struct source
private final org.apache.kafka.connect.data.Struct transaction
private final String op
private final org.apache.kafka.connect.data.Schema opSchema
private final String ts_ms
private final org.apache.kafka.connect.data.Schema ts_msSchema
private final org.apache.kafka.connect.data.Schema dataSchema
private final String connectorType
protected RecordParser(org.apache.kafka.connect.data.Schema schema,
org.apache.kafka.connect.data.Struct record,
String... dataFields)
public static RecordParser create(org.apache.kafka.connect.data.Schema schema, Object value)
schema - the schema of the recordvalue - the value of the recordprivate static org.apache.kafka.connect.data.Schema getDataSchema(org.apache.kafka.connect.data.Schema schema,
String connectorType,
String... fields)
public org.apache.kafka.connect.data.Struct data()
public org.apache.kafka.connect.data.Struct source()
public org.apache.kafka.connect.data.Struct transaction()
public String op()
public org.apache.kafka.connect.data.Schema opSchema()
public String ts_ms()
public org.apache.kafka.connect.data.Schema ts_msSchema()
public org.apache.kafka.connect.data.Schema dataSchema()
public String connectorType()
Copyright © 2021 JBoss by Red Hat. All rights reserved.