Class RecordMakers.RecordsForTable
- java.lang.Object
-
- io.debezium.connector.mysql.legacy.RecordMakers.RecordsForTable
-
- Enclosing class:
- RecordMakers
public final class RecordMakers.RecordsForTable extends Object
ASourceRecordfactory for a specific table and consumer.
-
-
Field Summary
Fields Modifier and Type Field Description private BlockingConsumer<org.apache.kafka.connect.source.SourceRecord>consumerprivate RecordMakers.Converterconverterprivate BitSetincludedColumns
-
Constructor Summary
Constructors Modifier Constructor Description protectedRecordsForTable(RecordMakers.Converter converter, BitSet includedColumns, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcreate(Object[] row, Instant ts)Produce acreaterecord for the row.intcreate(Object[] row, Instant ts, int rowNumber, int numberOfRows)Produce acreaterecord for the row.intdelete(Object[] row, Instant ts)Produce adeleterecord for the row.intdelete(Object[] row, Instant ts, int rowNumber, int numberOfRows)Produce adeleterecord for the row.intread(Object[] row, Instant ts)Produce areadrecord for the row.intread(Object[] row, Instant ts, int rowNumber, int numberOfRows)Produce areadrecord for the row.intupdate(Object[] before, Object[] after, Instant ts)Produce anupdaterecord for the row.intupdate(Object[] before, Object[] after, Instant ts, int rowNumber, int numberOfRows)Produce anupdaterecord for the row.
-
-
-
Field Detail
-
includedColumns
private final BitSet includedColumns
-
converter
private final RecordMakers.Converter converter
-
consumer
private final BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer
-
-
Constructor Detail
-
RecordsForTable
protected RecordsForTable(RecordMakers.Converter converter, BitSet includedColumns, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> consumer)
-
-
Method Detail
-
read
public int read(Object[] row, Instant ts) 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 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
public int create(Object[] row, Instant ts) 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 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
public int update(Object[] before, Object[] after, Instant ts) 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 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
public int delete(Object[] row, Instant ts) 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 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
-
-