Package io.debezium.connector.jdbc
Class RecordBuffer
java.lang.Object
io.debezium.connector.jdbc.RecordBuffer
- All Implemented Interfaces:
Buffer
A buffer of
SinkRecordDescriptor. It contains the logic of when is the time to flush- Author:
- Mario Fiore Vitale
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JdbcSinkConnectorConfigprivate org.apache.kafka.connect.data.Schemaprivate final ArrayList<SinkRecordDescriptor>private org.apache.kafka.connect.data.Schema -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(SinkRecordDescriptor recordDescriptor) to add aSinkRecordDescriptorto the internal buffer and call theBuffer.flush()when buffer size >=JdbcSinkConnectorConfig.getBatchSize()flush()to clear and flush the internal bufferbooleanisEmpty()to check whether buffer is empty or not.
-
Field Details
-
connectorConfig
-
keySchema
private org.apache.kafka.connect.data.Schema keySchema -
valueSchema
private org.apache.kafka.connect.data.Schema valueSchema -
records
-
-
Constructor Details
-
RecordBuffer
-
-
Method Details
-
add
Description copied from interface:Bufferto add aSinkRecordDescriptorto the internal buffer and call theBuffer.flush()when buffer size >=JdbcSinkConnectorConfig.getBatchSize() -
flush
Description copied from interface:Bufferto clear and flush the internal buffer- Specified by:
flushin interfaceBuffer- Returns:
SinkRecordDescriptorthe flushed buffer records.
-
isEmpty
public boolean isEmpty()Description copied from interface:Bufferto check whether buffer is empty or not.
-