Class RecordMakers.RecordsForTable
- java.lang.Object
-
- io.debezium.connector.mysql.legacy.RecordMakers.RecordsForTable
-
- Enclosing class:
- RecordMakers
public final class RecordMakers.RecordsForTable extends Object
ASourceRecord
factory for a specific table and consumer.
-
-
Field Summary
Fields Modifier and Type Field Description private BlockingConsumer<org.apache.kafka.connect.source.SourceRecord>
consumer
private RecordMakers.Converter
converter
private BitSet
includedColumns
-
Constructor Summary
Constructors Modifier Constructor Description protected
RecordsForTable(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 int
create(Object[] row, Instant ts)
Produce acreate
record for the row.int
create(Object[] row, Instant ts, int rowNumber, int numberOfRows)
Produce acreate
record for the row.int
delete(Object[] row, Instant ts)
Produce adelete
record for the row.int
delete(Object[] row, Instant ts, int rowNumber, int numberOfRows)
Produce adelete
record for the row.int
read(Object[] row, Instant ts)
Produce aread
record for the row.int
read(Object[] row, Instant ts, int rowNumber, int numberOfRows)
Produce aread
record for the row.int
update(Object[] before, Object[] after, Instant ts)
Produce anupdate
record for the row.int
update(Object[] before, Object[] after, Instant ts, int rowNumber, int numberOfRows)
Produce anupdate
record 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 aread
record for the row.- Parameters:
row
- the values of the row, in the same order as the columns in theTable
definition 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 aread
record for the row.- Parameters:
row
- the values of the row, in the same order as the columns in theTable
definition 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 acreate
record for the row.- Parameters:
row
- the values of the row, in the same order as the columns in theTable
definition 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 acreate
record for the row.- Parameters:
row
- the values of the row, in the same order as the columns in theTable
definition 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 anupdate
record for the row.- Parameters:
before
- the values of the row before the update, in the same order as the columns in theTable
definition in theMySqlSchema
after
- the values of the row after the update, in the same order as the columns in theTable
definition 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
-
update
public int update(Object[] before, Object[] after, Instant ts, int rowNumber, int numberOfRows) throws InterruptedException
Produce anupdate
record for the row.- Parameters:
before
- the values of the row before the update, in the same order as the columns in theTable
definition in theMySqlSchema
after
- the values of the row after the update, in the same order as the columns in theTable
definition 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
-
delete
public int delete(Object[] row, Instant ts) throws InterruptedException
Produce adelete
record for the row.- Parameters:
row
- the values of the row, in the same order as the columns in theTable
definition 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 adelete
record for the row.- Parameters:
row
- the values of the row, in the same order as the columns in theTable
definition 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
-
-