public abstract class RelationalChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition>
extends io.debezium.pipeline.AbstractChangeRecordEmitter<P,io.debezium.relational.TableSchema>
Base class for ChangeRecordEmitter implementations based on a relational database.
This class overrides the emit methods to put some values in the header.
Line 59 ~ 257: add other headers and emit.
| Modifier and Type | Field and Description |
|---|---|
static String |
PK_UPDATE_NEWKEY_FIELD |
static String |
PK_UPDATE_OLDKEY_FIELD |
| Constructor and Description |
|---|
RelationalChangeRecordEmitter(P partition,
io.debezium.pipeline.spi.OffsetContext offsetContext,
io.debezium.util.Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
void |
emitChangeRecords(io.debezium.schema.DataCollectionSchema schema,
io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver) |
protected void |
emitCreateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver,
io.debezium.relational.TableSchema tableSchema) |
protected void |
emitDeleteRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver,
io.debezium.relational.TableSchema tableSchema) |
protected void |
emitReadRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver,
io.debezium.relational.TableSchema tableSchema) |
protected void |
emitTruncateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver,
io.debezium.relational.TableSchema schema) |
protected void |
emitUpdateAsPrimaryKeyChangeRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver,
io.debezium.relational.TableSchema tableSchema,
org.apache.kafka.connect.data.Struct oldKey,
org.apache.kafka.connect.data.Struct newKey,
org.apache.kafka.connect.data.Struct oldValue,
org.apache.kafka.connect.data.Struct newValue) |
protected void |
emitUpdateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver,
io.debezium.relational.TableSchema tableSchema) |
protected Optional<org.apache.kafka.connect.header.ConnectHeaders> |
getEmitConnectHeaders() |
protected abstract Object[] |
getNewColumnValues()
Returns the new row state in case of a CREATE or READ.
|
protected abstract Object[] |
getOldColumnValues()
Returns the old row state in case of an UPDATE or DELETE.
|
protected boolean |
skipEmptyMessages()
Whether empty data messages should be ignored.
|
getClock, getOffset, getPartitionpublic static final String PK_UPDATE_OLDKEY_FIELD
public static final String PK_UPDATE_NEWKEY_FIELD
public RelationalChangeRecordEmitter(P partition, io.debezium.pipeline.spi.OffsetContext offsetContext, io.debezium.util.Clock clock)
public void emitChangeRecords(io.debezium.schema.DataCollectionSchema schema,
io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver)
throws InterruptedException
emitChangeRecords in interface io.debezium.pipeline.spi.ChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition>emitChangeRecords in class io.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>InterruptedExceptionprotected void emitCreateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema) throws InterruptedException
emitCreateRecord in class io.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>InterruptedExceptionprotected void emitReadRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema) throws InterruptedException
emitReadRecord in class io.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>InterruptedExceptionprotected void emitUpdateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema) throws InterruptedException
emitUpdateRecord in class io.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>InterruptedExceptionprotected void emitDeleteRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema) throws InterruptedException
emitDeleteRecord in class io.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>InterruptedExceptionprotected void emitTruncateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema schema) throws InterruptedException
InterruptedExceptionprotected abstract Object[] getOldColumnValues()
protected abstract Object[] getNewColumnValues()
protected boolean skipEmptyMessages()
protected void emitUpdateAsPrimaryKeyChangeRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema, org.apache.kafka.connect.data.Struct oldKey, org.apache.kafka.connect.data.Struct newKey, org.apache.kafka.connect.data.Struct oldValue, org.apache.kafka.connect.data.Struct newValue) throws InterruptedException
InterruptedExceptionprotected Optional<org.apache.kafka.connect.header.ConnectHeaders> getEmitConnectHeaders()
Copyright © 2024 The Apache Software Foundation. All rights reserved.