Package io.debezium.relational
Class RelationalChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition>
- java.lang.Object
-
- io.debezium.pipeline.AbstractChangeRecordEmitter<P,io.debezium.relational.TableSchema>
-
- io.debezium.relational.RelationalChangeRecordEmitter<P>
-
- All Implemented Interfaces:
io.debezium.pipeline.spi.ChangeRecordEmitter<P>
- Direct Known Subclasses:
io.debezium.connector.oracle.BaseChangeRecordEmitter
public abstract class RelationalChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition> extends io.debezium.pipeline.AbstractChangeRecordEmitter<P,io.debezium.relational.TableSchema>Copied from Debezium 1.9.8.Final.Base class for
ChangeRecordEmitterimplementations 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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPK_UPDATE_NEWKEY_FIELDstatic StringPK_UPDATE_OLDKEY_FIELD
-
Constructor Summary
Constructors Constructor Description RelationalChangeRecordEmitter(P partition, io.debezium.pipeline.spi.OffsetContext offsetContext, io.debezium.util.Clock clock)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidemitChangeRecords(io.debezium.schema.DataCollectionSchema schema, io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver)protected voidemitCreateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema)protected voidemitDeleteRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema)protected voidemitReadRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema)protected voidemitTruncateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema schema)protected voidemitUpdateAsPrimaryKeyChangeRecord(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 voidemitUpdateRecord(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 booleanskipEmptyMessages()Whether empty data messages should be ignored.-
Methods inherited from class io.debezium.pipeline.AbstractChangeRecordEmitter
getClock, getOffset, getPartition
-
-
-
-
Field Detail
-
PK_UPDATE_OLDKEY_FIELD
public static final String PK_UPDATE_OLDKEY_FIELD
- See Also:
- Constant Field Values
-
PK_UPDATE_NEWKEY_FIELD
public static final String PK_UPDATE_NEWKEY_FIELD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RelationalChangeRecordEmitter
public RelationalChangeRecordEmitter(P partition, io.debezium.pipeline.spi.OffsetContext offsetContext, io.debezium.util.Clock clock)
-
-
Method Detail
-
emitChangeRecords
public void emitChangeRecords(io.debezium.schema.DataCollectionSchema schema, io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver) throws InterruptedException- Specified by:
emitChangeRecordsin interfaceio.debezium.pipeline.spi.ChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition>- Overrides:
emitChangeRecordsin classio.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>- Throws:
InterruptedException
-
emitCreateRecord
protected void emitCreateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema) throws InterruptedException
- Specified by:
emitCreateRecordin classio.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>- Throws:
InterruptedException
-
emitReadRecord
protected void emitReadRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema) throws InterruptedException
- Specified by:
emitReadRecordin classio.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>- Throws:
InterruptedException
-
emitUpdateRecord
protected void emitUpdateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema) throws InterruptedException
- Specified by:
emitUpdateRecordin classio.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>- Throws:
InterruptedException
-
emitDeleteRecord
protected void emitDeleteRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema tableSchema) throws InterruptedException
- Specified by:
emitDeleteRecordin classio.debezium.pipeline.AbstractChangeRecordEmitter<P extends io.debezium.pipeline.spi.Partition,io.debezium.relational.TableSchema>- Throws:
InterruptedException
-
emitTruncateRecord
protected void emitTruncateRecord(io.debezium.pipeline.spi.ChangeRecordEmitter.Receiver<P> receiver, io.debezium.relational.TableSchema schema) throws InterruptedException
- Throws:
InterruptedException
-
getOldColumnValues
protected abstract Object[] getOldColumnValues()
Returns the old row state in case of an UPDATE or DELETE.
-
getNewColumnValues
protected abstract Object[] getNewColumnValues()
Returns the new row state in case of a CREATE or READ.
-
skipEmptyMessages
protected boolean skipEmptyMessages()
Whether empty data messages should be ignored.- Returns:
- true if empty data messages coming from data source should be ignored. Typical use case are PostgreSQL changes without FULL replica identity.
-
emitUpdateAsPrimaryKeyChangeRecord
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
- Throws:
InterruptedException
-
getEmitConnectHeaders
protected Optional<org.apache.kafka.connect.header.ConnectHeaders> getEmitConnectHeaders()
-
-