Class RecordMakers.RecordsForTable
java.lang.Object
io.debezium.connector.mysql.legacy.RecordMakers.RecordsForTable
- Enclosing class:
- RecordMakers
A
SourceRecord factory for a specific table and consumer.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockingConsumer<org.apache.kafka.connect.source.SourceRecord>private final RecordMakers.Converterprivate final BitSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRecordsForTable(RecordMakers.Converter converter, BitSet includedColumns, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer) -
Method Summary
Modifier and TypeMethodDescriptionintProduce acreaterecord for the row.intProduce acreaterecord for the row.intProduce adeleterecord for the row.intProduce adeleterecord for the row.intProduce areadrecord for the row.intProduce areadrecord for the row.intProduce anupdaterecord for the row.intProduce anupdaterecord for the row.
-
Field Details
-
includedColumns
-
converter
-
consumer
-
-
Constructor Details
-
RecordsForTable
protected RecordsForTable(RecordMakers.Converter converter, BitSet includedColumns, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer)
-
-
Method Details
-
read
Produce areadrecord for the row.- Parameters:
row- the values of the row, in the same order as the columns in theTabledefinition in theMySqlSchema.ts- the timestamp for this row- Returns:
- the number of records produced; will be 0 or more
- Throws:
InterruptedException- if this thread is interrupted while waiting to give a source record to the consumer
-
read
public int read(Object[] row, Instant ts, int rowNumber, int numberOfRows) throws InterruptedException Produce areadrecord for the row.- Parameters:
row- the values of the row, in the same order as the columns in theTabledefinition in theMySqlSchema.ts- the timestamp for this rowrowNumber- the number of this row; must be 0 or morenumberOfRows- the total number of rows to be read; must be 1 or more- Returns:
- the number of records produced; will be 0 or more
- Throws:
InterruptedException- if this thread is interrupted while waiting to give a source record to the consumer
-
create
Produce acreaterecord for the row.- Parameters:
row- the values of the row, in the same order as the columns in theTabledefinition in theMySqlSchema.ts- the timestamp for this row- Returns:
- the number of records produced; will be 0 or more
- Throws:
InterruptedException- if this thread is interrupted while waiting to give a source record to the consumer
-
create
public int create(Object[] row, Instant ts, int rowNumber, int numberOfRows) throws InterruptedException Produce acreaterecord for the row.- Parameters:
row- the values of the row, in the same order as the columns in theTabledefinition in theMySqlSchema.ts- the timestamp for this rowrowNumber- the number of this row; must be 0 or morenumberOfRows- the total number of rows to be read; must be 1 or more- Returns:
- the number of records produced; will be 0 or more
- Throws:
InterruptedException- if this thread is interrupted while waiting to give a source record to the consumer
-
update
Produce anupdaterecord for the row.- Parameters:
before- the values of the row before the update, in the same order as the columns in theTabledefinition in theMySqlSchemaafter- the values of the row after the update, in the same order as the columns in theTabledefinition in theMySqlSchemats- the timestamp for this row- Returns:
- the number of records produced; will be 0 or more
- Throws:
InterruptedException- if this thread is interrupted while waiting to give a source record to the consumer
-
update
public int update(Object[] before, Object[] after, Instant ts, int rowNumber, int numberOfRows) throws InterruptedException Produce anupdaterecord for the row.- Parameters:
before- the values of the row before the update, in the same order as the columns in theTabledefinition in theMySqlSchemaafter- the values of the row after the update, in the same order as the columns in theTabledefinition in theMySqlSchemats- the timestamp for this rowrowNumber- the number of this row; must be 0 or morenumberOfRows- the total number of rows to be read; must be 1 or more- Returns:
- the number of records produced; will be 0 or more
- Throws:
InterruptedException- if this thread is interrupted while waiting to give a source record to the consumer
-
delete
Produce adeleterecord for the row.- Parameters:
row- the values of the row, in the same order as the columns in theTabledefinition in theMySqlSchema.ts- the timestamp for this row- Returns:
- the number of records produced; will be 0 or more
- Throws:
InterruptedException- if this thread is interrupted while waiting to give a source record to the consumer
-
delete
public int delete(Object[] row, Instant ts, int rowNumber, int numberOfRows) throws InterruptedException Produce adeleterecord for the row.- Parameters:
row- the values of the row, in the same order as the columns in theTabledefinition in theMySqlSchema.ts- the timestamp for this rowrowNumber- the number of this row; must be 0 or morenumberOfRows- the total number of rows to be read; must be 1 or more- Returns:
- the number of records produced; will be 0 or more
- Throws:
InterruptedException- if this thread is interrupted while waiting to give a source record to the consumer
-